From d4fde4e2afafd24003c45c1e9419fc42637b9586 Mon Sep 17 00:00:00 2001 From: ramana Date: Mon, 13 Apr 2009 08:25:55 +0000 Subject: [PATCH] 2009-04-13 Ramana Radhakrishnan * 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 | 14 ++++++++++++++ gcc/config/arm/arm.c | 16 ++++++---------- gcc/config/arm/arm.h | 3 +++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c9d910de5e..0544dd6a232 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2009-04-13 Ramana Radhakrishnan + + * 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 * doc/install.texi: Correct description of default directory for diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 662e7de1e49..e24f3c7868e 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -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 ())) diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index f5ec9e7166e..a44b40388d7 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -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; -- 2.11.0