avr.h (machine_function): Add 'is_leaf' field.
authorAnatoly Sokolov <aesok@post.ru>
Mon, 12 May 2008 20:39:51 +0000 (00:39 +0400)
committerAnatoly Sokolov <aesok@gcc.gnu.org>
Mon, 12 May 2008 20:39:51 +0000 (00:39 +0400)
* config/avr/avr.h (machine_function): Add 'is_leaf' field.
* config/avr/avr.c (avr_regs_to_save): Compute 'machine->is_leaf'.
Use 'machine->is_leaf' instead of 'leaf_func_p'.

From-SVN: r135231

gcc/ChangeLog
gcc/config/avr/avr.c
gcc/config/avr/avr.h

index bcf6c64b6a3d2f88bcef87e7c064db97156d23ad..27204b40bd3bcfc4ce16b9fa89e2557ac1198b2f 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-12  Anatoly Sokolov <aesok@post.ru>
+
+       * config/avr/avr.h (machine_function): Add 'is_leaf' field.
+       * config/avr/avr.c (avr_regs_to_save): Compute 'machine->is_leaf'.
+       Use 'machine->is_leaf' instead of 'leaf_func_p'.
+
 2008-05-12  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/sse.md (*sse_concatv4sf): Renamed to ...
index 7248fd6a27cdd8496c59c620af3d13d465ea02d1..e1d77758c3cdcf8ad189384787bc63e4e122402d 100644 (file)
@@ -471,7 +471,9 @@ avr_regs_to_save (HARD_REG_SET *set)
   int reg, count;
   int int_or_sig_p = (interrupt_function_p (current_function_decl)
                      || signal_function_p (current_function_decl));
-  int leaf_func_p = leaf_function_p ();
+
+  if (!reload_completed)
+    cfun->machine->is_leaf = leaf_function_p ();
 
   if (set)
     CLEAR_HARD_REG_SET (*set);
@@ -490,7 +492,7 @@ avr_regs_to_save (HARD_REG_SET *set)
       if (fixed_regs[reg])
        continue;
 
-      if ((int_or_sig_p && !leaf_func_p && call_used_regs[reg])
+      if ((int_or_sig_p && !cfun->machine->is_leaf && call_used_regs[reg])
          || (df_regs_ever_live_p (reg)
              && (int_or_sig_p || !call_used_regs[reg])
              && !(frame_pointer_needed
index 7dbc76ce9de2ac6ef60d729853d0e7251c5311f1..b56c8e044fc9db1dd94dd528cc2c9fb768d807b7 100644 (file)
@@ -1026,6 +1026,9 @@ mmcu=*:-mmcu=%*}"
    This is added to the cfun structure.  */
 struct machine_function GTY(())
 {
+  /* 'true' - if the current function is a leaf function.  */
+  int is_leaf;
+
   /* 'true' - if current function is a naked function.  */
   int is_naked;