XStormy16: Fix selection of return instruction for interrupt handlers.

Message ID m3ipzy98k0.fsf@redhat.com
State New
Headers show

Commit Message

Nick Clifton Nov. 15, 2010, 10:37 a.m.
Hi Guys,

  I am applying the patch below to fix a small bug in the XStormy16
  backend.  Under some circumstances it was possible for the backend to
  generate a RET instruction to return from an interrupt handler instead
  of an IRET instruction.  This patch fixes that problem.


2010-11-15  Nick Clifton  <nickc@redhat.com>

	* config/stormy16/stormy16.c (direct_return): Do not generate a
	direct return for interrupt handlers.


Index: gcc/config/stormy16/stormy16.c
--- gcc/config/stormy16/stormy16.c	(revision 166743)
+++ gcc/config/stormy16/stormy16.c	(working copy)
@@ -1175,7 +1175,8 @@ 
 direct_return (void)
   return (reload_completed
-	  && xstormy16_compute_stack_layout ().frame_size == 0);
+	  && xstormy16_compute_stack_layout ().frame_size == 0
+	  && ! xstormy16_interrupt_function_p ());
 /* Called after register allocation to add any instructions needed for