]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aix: packed struct alignment [PR102068]
authorDavid Edelsohn <dje.gcc@gmail.com>
Thu, 26 Aug 2021 21:14:18 +0000 (17:14 -0400)
committerDavid Edelsohn <dje.gcc@gmail.com>
Fri, 27 Aug 2021 01:19:22 +0000 (21:19 -0400)
Further fixes to structure alignment when the structure is packed
and contains double.  This patch checks for packed attribute
at the top level.

gcc/ChangeLog:

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

gcc/config/rs6000/rs6000.c

index e073b26b43079fe770020bbb1bbdd320d893fdba..05fb6aad4b07b96334c6ebd6524f74b460eadbfd 100644 (file)
@@ -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;
 
   /* Strip initial arrays.  */