summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-08 13:56:06 +0000
committermatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-08 13:56:06 +0000
commita4da9a838a736ecdb4a2dd71198c687d85468b83 (patch)
treec537ebdbca988616de7016720b46a6181b211688 /gcc/function.c
parent4b68c8f791fda8f94422fbeadf6b3490e90bcd23 (diff)
downloadgcc-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.c22
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--;
}