diff options
author | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-08 13:56:06 +0000 |
---|---|---|
committer | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-12-08 13:56:06 +0000 |
commit | a4da9a838a736ecdb4a2dd71198c687d85468b83 (patch) | |
tree | c537ebdbca988616de7016720b46a6181b211688 /gcc/function.c | |
parent | 4b68c8f791fda8f94422fbeadf6b3490e90bcd23 (diff) | |
download | gcc-a4da9a838a736ecdb4a2dd71198c687d85468b83.tar.gz |
PR middle-end/38474
* function.c (free_temp_slots): Only walk the temp slot
addresses and combine slots if we actually changes something.
(pop_temp_slots): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155087 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c index b8042d08551..ac5ba94f9d1 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1164,17 +1164,24 @@ void free_temp_slots (void) { struct temp_slot *p, *next; + bool some_available = false; for (p = *temp_slots_at_level (temp_slot_level); p; p = next) { next = p->next; if (!p->keep) - make_slot_available (p); + { + make_slot_available (p); + some_available = true; + } } - remove_unused_temp_slot_addresses (); - combine_temp_slots (); + if (some_available) + { + remove_unused_temp_slot_addresses (); + combine_temp_slots (); + } } /* Push deeper into the nesting level for stack temporaries. */ @@ -1192,15 +1199,20 @@ void pop_temp_slots (void) { struct temp_slot *p, *next; + bool some_available = false; for (p = *temp_slots_at_level (temp_slot_level); p; p = next) { next = p->next; make_slot_available (p); + some_available = true; } - remove_unused_temp_slot_addresses (); - combine_temp_slots (); + if (some_available) + { + remove_unused_temp_slot_addresses (); + combine_temp_slots (); + } temp_slot_level--; } |