diff mbox series

AIX packed structure alignment [PR102068]

Message ID CAGWvnykKcF+ho1_sm0Xfr5CT5RZgiNmEabJnBUNN35ejLmZkvQ@mail.gmail.com
State New
Headers show
Series AIX packed structure alignment [PR102068] | expand

Commit Message

David Edelsohn Aug. 27, 2021, 1:14 a.m. UTC
Further fixes to structure alignment when the structure is packed
    and contains double.  This patch checks for packed attribute
    at the top level.

Bootstrapped on powerpc-ibm-aix7.2.3.0

    gcc/ChangeLog:

            PR target/102068
            * config/rs6000/rs6000.c (rs6000_adjust_field_align): Use
            computed alignment if the entire struct has attribute packed.

   /* Strip initial arrays.  */
diff mbox series

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e073b26b430..05fb6aad4b0 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -7955,7 +7955,7 @@  rs6000_slow_unaligned_access (machine_mode mode,
unsigned int align)
 unsigned int
 rs6000_special_adjust_field_align (tree type, unsigned int computed)
 {
-  if (computed <= 32)
+  if (computed <= 32 || TYPE_PACKED (type))
     return computed;