diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2011-12-05 19:32:16 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-12-05 19:32:16 +0000 |
commit | dfa51991efb62e04c7b41d9825d0cff12061e2e4 (patch) | |
tree | 65db31735c6861639ec33f3d20a2191f62c65382 /gcc | |
parent | fae67e1dc40c1ffa336ef06299844a6622566ccd (diff) | |
download | gcc-dfa51991efb62e04c7b41d9825d0cff12061e2e4.zip gcc-dfa51991efb62e04c7b41d9825d0cff12061e2e4.tar.gz gcc-dfa51991efb62e04c7b41d9825d0cff12061e2e4.tar.bz2 |
resource.c (init_resource_info): Only consider EXIT_IGNORE_STACK if there is in epilogue.
gcc/
* resource.c (init_resource_info): Only consider EXIT_IGNORE_STACK
if there is in epilogue.
From-SVN: r182023
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/resource.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 762c57f..cc90010 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2011-12-05 Richard Sandiford <rdsandiford@googlemail.com> + * resource.c (init_resource_info): Only consider EXIT_IGNORE_STACK + if there is in epilogue. + +2011-12-05 Richard Sandiford <rdsandiford@googlemail.com> + * optabs.c (maybe_emit_sync_lock_test_and_set): Pass a null target to emit_library_call_value. (expand_atomic_compare_and_swap): Likewise. diff --git a/gcc/resource.c b/gcc/resource.c index 1a8cb1b..e5fa91f 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -1145,11 +1145,11 @@ init_resource_info (rtx epilogue_insn) basic_block bb; /* Indicate what resources are required to be valid at the end of the current - function. The condition code never is and memory always is. If the - frame pointer is needed, it is and so is the stack pointer unless - EXIT_IGNORE_STACK is nonzero. If the frame pointer is not needed, the - stack pointer is. Registers used to return the function value are - needed. Registers holding global variables are needed. */ + function. The condition code never is and memory always is. + The stack pointer is needed unless EXIT_IGNORE_STACK is true + and there is an epilogue that restores the original stack pointer + from the frame pointer. Registers used to return the function value + are needed. Registers holding global variables are needed. */ end_of_function_needs.cc = 0; end_of_function_needs.memory = 1; @@ -1162,11 +1162,11 @@ init_resource_info (rtx epilogue_insn) #if !HARD_FRAME_POINTER_IS_FRAME_POINTER SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM); #endif - if (! EXIT_IGNORE_STACK - || current_function_sp_is_unchanging) - SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM); } - else + if (!(frame_pointer_needed + && EXIT_IGNORE_STACK + && epilogue_insn + && !current_function_sp_is_unchanging)) SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM); if (crtl->return_rtx != 0) |