function.h (struct function): Rename calls_unwind_init to saves_all_registers.
authorRoman Zippel <zippel@linux-m68k.org>
Fri, 7 Sep 2007 16:46:23 +0000 (16:46 +0000)
committerRoman Zippel <zippel@gcc.gnu.org>
Fri, 7 Sep 2007 16:46:23 +0000 (16:46 +0000)
* function.h (struct function): Rename calls_unwind_init
to saves_all_registers.
(current_function_saves_all_registers): Renamed from
current_function_calls_unwind_init.
* reload1.c (reload): Set current_function_saves_all_registers.
* except.c (expand_builtin_unwind_init): Likewise.
* config/m68k/m68k.c (m68k_save_reg): Use
current_function_saves_all_registers to save pic register.

From-SVN: r128248

gcc/ChangeLog
gcc/config/m68k/m68k.c
gcc/except.c
gcc/function.h
gcc/reload1.c

index 04922ebca133b4fbe4351d29e65003fa3d60f755..ec6b104d014905eeff82c76c34d3d81146b6ee8c 100644 (file)
@@ -1,3 +1,14 @@
+2007-09-07  Roman Zippel <zippel@linux-m68k.org>
+
+       * function.h (struct function): Rename calls_unwind_init
+       to saves_all_registers.
+       (current_function_saves_all_registers): Renamed from
+       current_function_calls_unwind_init.
+       * reload1.c (reload): Set current_function_saves_all_registers.
+       * except.c (expand_builtin_unwind_init): Likewise.
+       * config/m68k/m68k.c (m68k_save_reg): Use
+       current_function_saves_all_registers to save pic register.
+
 2007-09-07  Janis Johnson  <janis187@us.ibm.com>
 
        config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN.
index cd7f493815c9d3d806d90035bee7a84a386fc17a..8f7aa34f2286dd3ab1a347f012ec726faea180e3 100644 (file)
@@ -780,9 +780,7 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler)
 {
   if (flag_pic && regno == PIC_REG)
     {
-      /* A function that receives a nonlocal goto must save all call-saved
-        registers.  */
-      if (current_function_has_nonlocal_label)
+      if (current_function_saves_all_registers)
        return true;
       if (current_function_uses_pic_offset_table)
        return true;
index 02131eeb0fea1db8a7d54deeaa784498006fc66d..f3204eb863ace383c23470a7ca854bf7ce4cd742 100644 (file)
@@ -2867,7 +2867,7 @@ expand_builtin_unwind_init (void)
 {
   /* Set this so all the registers get saved in our frame; we need to be
      able to copy the saved values for any registers from frames we unwind.  */
-  current_function_calls_unwind_init = 1;
+  current_function_saves_all_registers = 1;
 
 #ifdef SETUP_FRAME_ADDRESSES
   SETUP_FRAME_ADDRESSES ();
index 1317d81f4e673ef1d4148f75e315c78602a5d356..27bde1c3bd0259838677751901f755fc182e6c26 100644 (file)
@@ -387,9 +387,10 @@ struct function GTY(())
      from nested functions.  */
   unsigned int has_nonlocal_label : 1;
 
-  /* Nonzero if function calls builtin_unwind_init.  */
-  unsigned int calls_unwind_init : 1;
-  
+  /* Nonzero if function saves all registers, e.g. if it has a nonlocal
+     label that can reach the exit block via non-exceptional paths. */
+  unsigned int saves_all_registers : 1;
+
   /* Nonzero if function being compiled has nonlocal gotos to parent
      function.  */
   unsigned int has_nonlocal_goto : 1;
@@ -503,7 +504,7 @@ extern void pop_cfun (void);
 #define current_function_uses_const_pool (cfun->uses_const_pool)
 #define current_function_epilogue_delay_list (cfun->epilogue_delay_list)
 #define current_function_has_nonlocal_label (cfun->has_nonlocal_label)
-#define current_function_calls_unwind_init (cfun->calls_unwind_init)
+#define current_function_saves_all_registers (cfun->saves_all_registers)
 #define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto)
 #define current_function_has_asm_statement (cfun->has_asm_statement)
 
index dada892171656194dd97cca18a1f347ec1f647be..270ea0654cf0bf578c8f74d24d13038b185eb4dc 100644 (file)
@@ -743,9 +743,11 @@ reload (rtx first, int global)
   /* A function that has a nonlocal label that can reach the exit
      block via non-exceptional paths must save all call-saved
      registers.  */
-  if (current_function_calls_unwind_init
-      || (current_function_has_nonlocal_label
-         && has_nonexceptional_receiver ()))
+  if (current_function_has_nonlocal_label
+      && has_nonexceptional_receiver ())
+    current_function_saves_all_registers = 1;
+
+  if (current_function_saves_all_registers)
     for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
       if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
        df_set_regs_ever_live (i, true);