2009-04-13 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
authorramana <ramana@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Apr 2009 08:25:55 +0000 (08:25 +0000)
committerramana <ramana@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Apr 2009 08:25:55 +0000 (08:25 +0000)
       * config/arm/arm.c (return_used_this_function): Remove.
       (arm_output_function_prologue): Remove use of
return_used_this_function.
       (output_return_instruction): Replace use of
return_used_this_function
by cfun->machine->return_used_this_function.
       (arm_output_epilogue): Likewise.
       (arm_output_function_epilogue): Likewise.
       (thumb_unexpanded_epilogue): Likewise.
       * config/arm/arm.h (struct machine_function):
New member return_used_this_function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145997 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h

index 3c9d910..0544dd6 100644 (file)
@@ -1,3 +1,17 @@
+2009-04-13  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
+
+       * config/arm/arm.c (return_used_this_function): Remove.
+       (arm_output_function_prologue): Remove use of
+       return_used_this_function.
+       (output_return_instruction): Replace use of
+       return_used_this_function
+       by cfun->machine->return_used_this_function.
+       (arm_output_epilogue): Likewise.
+       (arm_output_function_epilogue): Likewise.
+       (thumb_unexpanded_epilogue): Likewise.
+       * config/arm/arm.h (struct machine_function):
+       New member return_used_this_function.
+       
 2009-04-12  Mark Mitchell  <mark@codesourcery.com>
 
        * doc/install.texi: Correct description of default directory for
index 662e7de..e24f3c7 100644 (file)
@@ -582,10 +582,6 @@ enum machine_mode output_memory_reference_mode;
 /* The register number to be used for the PIC offset register.  */
 unsigned arm_pic_register = INVALID_REGNUM;
 
-/* Set to 1 when a return insn is output, this means that the epilogue
-   is not needed.  */
-int return_used_this_function;
-
 /* Set to 1 after arm_reorg has started.  Reset to start at the start of
    the next function.  */
 static int after_arm_reorg = 0;
@@ -11618,7 +11614,7 @@ output_return_instruction (rtx operand, int really_return, int reverse)
 
   sprintf (conditional, "%%?%%%c0", reverse ? 'D' : 'd');
 
-  return_used_this_function = 1;
+  cfun->machine->return_used_this_function = 1;
 
   offsets = arm_get_frame_offsets ();
   live_regs_mask = offsets->saved_regs_mask;
@@ -11883,7 +11879,6 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size)
   if (crtl->calls_eh_return)
     asm_fprintf (f, "\t@ Calls __builtin_eh_return.\n");
 
-  return_used_this_function = 0;
 }
 
 const char *
@@ -11904,7 +11899,8 @@ arm_output_epilogue (rtx sibling)
 
   /* If we have already generated the return instruction
      then it is futile to generate anything else.  */
-  if (use_return_insn (FALSE, sibling) && return_used_this_function)
+  if (use_return_insn (FALSE, sibling) && 
+      (cfun->machine->return_used_this_function != 0))
     return "";
 
   func_type = arm_current_func_type ();
@@ -12351,7 +12347,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
       /* ??? Probably not safe to set this here, since it assumes that a
         function will be emitted as assembly immediately after we generate
         RTL for it.  This does not happen for inline functions.  */
-      return_used_this_function = 0;
+      cfun->machine->return_used_this_function = 0;
     }
   else /* TARGET_32BIT */
     {
@@ -12359,7 +12355,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
       offsets = arm_get_frame_offsets ();
 
       gcc_assert (!use_return_insn (FALSE, NULL)
-                 || !return_used_this_function
+                 || (cfun->machine->return_used_this_function != 0)
                  || offsets->saved_regs == offsets->outgoing_args
                  || frame_pointer_needed);
 
@@ -17300,7 +17296,7 @@ thumb_unexpanded_epilogue (void)
   int had_to_push_lr;
   int size;
 
-  if (return_used_this_function)
+  if (cfun->machine->return_used_this_function != 0)
     return "";
 
   if (IS_NAKED (arm_current_func_type ()))
index f5ec9e7..a44b403 100644 (file)
@@ -1610,6 +1610,9 @@ typedef struct machine_function GTY(())
      register.  We can never call via LR or PC.  We can call via SP if a
      trampoline happens to be on the top of the stack.  */
   rtx call_via[14];
+  /* Set to 1 when a return insn is output, this means that the epilogue
+     is not needed.  */
+  int return_used_this_function;
 }
 machine_function;