From 9cca6a99da69dc2326806259f9c39e8082fc6463 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Mon, 15 Apr 1996 18:46:12 +0000 Subject: 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 --- gcc/function.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'gcc/function.c') diff --git a/gcc/function.c b/gcc/function.c index 150aa8e..54c668e 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1095,10 +1095,11 @@ mark_temp_addr_taken (x) p->addr_taken = 1; } -/* If X could be a reference to a temporary slot, mark that slot as belonging - to the to one level higher. If X matched one of our slots, just mark that - one. Otherwise, we can't easily predict which it is, so upgrade all of - them. Kept slots need not be touched. +/* If X could be a reference to a temporary slot, mark that slot as + belonging to the to one level higher than the current level. If X + matched one of our slots, just mark that one. Otherwise, we can't + 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 returns a value in memory. */ @@ -1149,12 +1150,15 @@ preserve_temp_slots (x) level in case we used its address. */ struct temp_slot *q; - for (q = temp_slots; q; q = q->next) - if (q != p && q->addr_taken && q->level == p->level) - q->level--; + if (p->level == temp_slot_level) + { + for (q = temp_slots; q; q = q->next) + if (q != p && q->addr_taken && q->level == p->level) + q->level--; - p->level--; - p->addr_taken = 0; + p->level--; + p->addr_taken = 0; + } return; } -- cgit v1.1