aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1994-11-15 14:55:15 +0000
committerDoug Evans <dje@gnu.org>1994-11-15 14:55:15 +0000
commitb2a80c0d2bb7bd4b7cb6fc0c56ea723a2dd8931c (patch)
tree8a24cd572b095504765ffa323b5345c856740c42
parentce3b28797522623ff8b6d1ae6aa30318a450a45c (diff)
downloadgcc-b2a80c0d2bb7bd4b7cb6fc0c56ea723a2dd8931c.zip
gcc-b2a80c0d2bb7bd4b7cb6fc0c56ea723a2dd8931c.tar.gz
gcc-b2a80c0d2bb7bd4b7cb6fc0c56ea723a2dd8931c.tar.bz2
(assign_stack_temp): Compute size of slot after
assign_stack_local has accounted for alignment. From-SVN: r8438
-rw-r--r--gcc/function.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 844af83..1a206a9 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -856,11 +856,21 @@ assign_stack_temp (mode, size, keep)
/* If we still didn't find one, make a new temporary. */
if (p == 0)
{
+ int frame_offset_old = frame_offset;
p = (struct temp_slot *) oballoc (sizeof (struct temp_slot));
- p->size = size;
/* If the temp slot mode doesn't indicate the alignment,
use the largest possible, so no one will be disappointed. */
p->slot = assign_stack_local (mode, size, mode == BLKmode ? -1 : 0);
+ /* The following slot size computation is necessary because we don't
+ know the actual size of the temporary slot until assign_stack_local
+ has performed all the frame alignment and size rounding for the
+ requested temporary. Otherwise combine_temp_slots won't think that
+ adjacent slots really are adjacent. */
+#ifdef FRAME_GROWS_DOWNWARD
+ p->size = frame_offset_old - frame_offset;
+#else
+ p->size = frame_offset - frame_offset_old;
+#endif
p->address = 0;
p->next = temp_slots;
temp_slots = p;