diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1996-04-15 18:46:12 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1996-04-15 18:46:12 +0000 |
commit | 9cca6a99da69dc2326806259f9c39e8082fc6463 (patch) | |
tree | 991d5868e87290bdb87586a6827bc97fc8410645 /gcc/function.c | |
parent | 1d2a8985b01849f45cf3d3e83c41f933421cf58b (diff) | |
download | gcc-9cca6a99da69dc2326806259f9c39e8082fc6463.zip gcc-9cca6a99da69dc2326806259f9c39e8082fc6463.tar.gz gcc-9cca6a99da69dc2326806259f9c39e8082fc6463.tar.bz2 |
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
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 22 |
1 files changed, 13 insertions, 9 deletions
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; } |