Commit 9cca6a99 by Mike Stump

function.c (preserve_temp_slots): Only preserve temporaries that happen to be at the current level.

	* function.c (preserve_temp_slots): Only preserve temporaries that
	happen to be at the current level.
Fixes p7325.C.

From-SVN: r11800
parent 1d2a8985
...@@ -1095,10 +1095,11 @@ mark_temp_addr_taken (x) ...@@ -1095,10 +1095,11 @@ mark_temp_addr_taken (x)
p->addr_taken = 1; p->addr_taken = 1;
} }
/* If X could be a reference to a temporary slot, mark that slot as belonging /* If X could be a reference to a temporary slot, mark that slot as
to the to one level higher. If X matched one of our slots, just mark that belonging to the to one level higher than the current level. If X
one. Otherwise, we can't easily predict which it is, so upgrade all of matched one of our slots, just mark that one. Otherwise, we can't
them. Kept slots need not be touched. easily predict which it is, so upgrade all of them. Kept slots
need not be touched.
This is called when an ({...}) construct occurs and a statement This is called when an ({...}) construct occurs and a statement
returns a value in memory. */ returns a value in memory. */
...@@ -1149,12 +1150,15 @@ preserve_temp_slots (x) ...@@ -1149,12 +1150,15 @@ preserve_temp_slots (x)
level in case we used its address. */ level in case we used its address. */
struct temp_slot *q; struct temp_slot *q;
for (q = temp_slots; q; q = q->next) if (p->level == temp_slot_level)
if (q != p && q->addr_taken && q->level == p->level) {
q->level--; for (q = temp_slots; q; q = q->next)
if (q != p && q->addr_taken && q->level == p->level)
q->level--;
p->level--; p->level--;
p->addr_taken = 0; p->addr_taken = 0;
}
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment