aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>2021-08-26 17:14:18 -0400
committerDavid Edelsohn <dje.gcc@gmail.com>2021-08-26 21:19:22 -0400
commit5faf7120398c9bf290758891a975da1f727d631a (patch)
tree573dcdf2d7431c466c7aa18d63a629aa9535f87e
parent0fa4787bf34b173ce6f198e99b6f6dd8a3f98014 (diff)
downloadgcc-5faf7120398c9bf290758891a975da1f727d631a.zip
gcc-5faf7120398c9bf290758891a975da1f727d631a.tar.gz
gcc-5faf7120398c9bf290758891a975da1f727d631a.tar.bz2
aix: packed struct alignment [PR102068]
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.
-rw-r--r--gcc/config/rs6000/rs6000.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e073b26..05fb6aa 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;
/* Strip initial arrays. */