function.c (assign_stack_temp_for_type): Round SIZE before calling assign_stack_local...
authorJeffrey A Law <law@cygnus.com>
Thu, 18 Feb 1999 17:51:58 +0000 (17:51 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 18 Feb 1999 17:51:58 +0000 (10:51 -0700)
        * function.c (assign_stack_temp_for_type): Round SIZE before calling
        assign_stack_local for BLKmode slots.

From-SVN: r25290

gcc/ChangeLog
gcc/function.c

index bdc71f9fb8295cb47624249b3de8e2ad23e81406..9e984068fea408237da536b0fd3262df70859a97 100644 (file)
@@ -1,3 +1,8 @@
+Thu Feb 18 18:47:09 1999  Jeffrey A Law  (law@cygnus.com)
+
+       * function.c (assign_stack_temp_for_type): Round SIZE before calling
+       assign_stack_local for BLKmode slots.
+
 Fri Feb 19 01:45:06 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * loop.c (strength_reduce): For derived givs, replace the
index a14a886d4e8414db679559c360b07786bb8ed052..05189d9c1b9b2cd603e4122e4c0bbcaa24f58bb1 100644 (file)
@@ -963,6 +963,18 @@ assign_stack_temp_for_type (mode, size, keep, type)
 
       p = (struct temp_slot *) oballoc (sizeof (struct temp_slot));
 
+      /* We are passing an explicit alignment request to assign_stack_local.
+        One side effect of that is assign_stack_local will not round SIZE
+        to ensure the frame offset remains suitably aligned.
+
+        So for requests which depended on the rounding of SIZE, we go ahead
+        and round it now.  We also make sure ALIGNMENT is at least
+        BIGGEST_ALIGNMENT.  */
+      if (mode == BLKmode)
+       {
+         align = MAX (align, BIGGEST_ALIGNMENT / BITS_PER_UNIT);
+         size = CEIL_ROUND (size, align);
+       }
       p->slot = assign_stack_local (mode, size, align);
 
       p->align = align;