rs6000.c (rs6000_stack_info): Correct altivec_padding_size calculation on AIX.
authorGeoffrey Keating <geoffk@apple.com>
Fri, 2 Feb 2007 01:47:02 +0000 (01:47 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Fri, 2 Feb 2007 01:47:02 +0000 (01:47 +0000)
* config/rs6000/rs6000.c (rs6000_stack_info): Correct
altivec_padding_size calculation on AIX.  Improve comment, add
assert to verify that it's right.

From-SVN: r121485

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 7aadf4e6930ae3c301f3b9f464012e392b9b81cd..8124079c72926ca309df92689e4808133ab2f783 100644 (file)
@@ -1,5 +1,9 @@
 2007-02-01  Geoffrey Keating  <geoffk@apple.com>
 
+       * config/rs6000/rs6000.c (rs6000_stack_info): Correct
+       altivec_padding_size calculation on AIX.  Improve comment, add
+       assert to verify that it's right.
+
        * config/rs6000/darwin.h (MD_UNWIND_SUPPORT): Don't define for
        64-bit.
 
index dbb1f550f9727f3e475497b473b1c79261744876..8c05776796fbab473bed5d7031e6ac541c3de8e6 100644 (file)
@@ -13392,10 +13392,11 @@ rs6000_stack_info (void)
          info_ptr->vrsave_save_offset
            = info_ptr->gp_save_offset - info_ptr->vrsave_size;
 
-         /* Align stack so vector save area is on a quadword boundary.  */
+         /* Align stack so vector save area is on a quadword boundary.  
+            The padding goes above the vectors.  */
          if (info_ptr->altivec_size != 0)
            info_ptr->altivec_padding_size
-             = (-info_ptr->vrsave_save_offset) % 16;
+             = info_ptr->vrsave_save_offset & 0xF;
          else
            info_ptr->altivec_padding_size = 0;
 
@@ -13403,6 +13404,8 @@ rs6000_stack_info (void)
            = info_ptr->vrsave_save_offset
            - info_ptr->altivec_padding_size
            - info_ptr->altivec_size;
+         gcc_assert (info_ptr->altivec_size == 0
+                     || info_ptr->altivec_save_offset % 16 == 0);
 
          /* Adjust for AltiVec case.  */
          info_ptr->ehrd_offset = info_ptr->altivec_save_offset - ehrd_size;