rx.c (rx_get_stack_layout): Only save call clobbered registers inside interrupt handl...
authorNick Clifton <nickc@redhat.com>
Mon, 31 Jan 2011 11:38:43 +0000 (11:38 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Mon, 31 Jan 2011 11:38:43 +0000 (11:38 +0000)
* config/rx/rx.c (rx_get_stack_layout): Only save call clobbered
registers inside interrupt handlers if the handler is not a leaf
function.

From-SVN: r169434

gcc/ChangeLog
gcc/config/rx/rx.c

index d887424cd44d49a3e39dffa771163c4750713b0d..b054ad27568930b1591aaae602fa8b23e90d3882 100644 (file)
@@ -1,3 +1,9 @@
+2011-01-31  Nick Clifton  <nickc@redhat.com>
+
+       * config/rx/rx.c (rx_get_stack_layout): Only save call clobbered
+       registers inside interrupt handlers if the handler is not a leaf
+       function.
+
 2011-01-31  Nick Clifton  <nickc@redhat.com>
 
        * config/mn10300/mn10300.c (mn10300_regno_in_class_p): Check for
index 8fa48a35827a7c452fd22add79e624545b63fbe2..81991067b838ca9ff547cb1c003632a64ca7f5b5 100644 (file)
@@ -1137,10 +1137,12 @@ rx_get_stack_layout (unsigned int * lowest,
   for (save_mask = high = low = 0, reg = 1; reg < CC_REGNUM; reg++)
     {
       if ((df_regs_ever_live_p (reg)
-          /* Always save all call clobbered registers inside interrupt
-             handlers, even if they are not live - they may be used in
-             routines called from this one.  */
-          || (call_used_regs[reg] && is_interrupt_func (NULL_TREE)))
+          /* Always save all call clobbered registers inside non-leaf
+             interrupt handlers, even if they are not live - they may
+             be used in (non-interrupt aware) routines called from this one.  */
+          || (call_used_regs[reg]
+              && is_interrupt_func (NULL_TREE)
+              && ! current_function_is_leaf))
          && (! call_used_regs[reg]
              /* Even call clobbered registered must
                 be pushed inside interrupt handlers.  */