public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3178] aix: packed struct alignment [PR102068]
@ 2021-08-27  1:16 David Edelsohn
  0 siblings, 0 replies; only message in thread
From: David Edelsohn @ 2021-08-27  1:16 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5faf7120398c9bf290758891a975da1f727d631a

commit r12-3178-g5faf7120398c9bf290758891a975da1f727d631a
Author: David Edelsohn <dje.gcc@gmail.com>
Date:   Thu Aug 26 17:14:18 2021 -0400

    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.

Diff:
---
 gcc/config/rs6000/rs6000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 
   /* Strip initial arrays.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-27  1:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27  1:16 [gcc r12-3178] aix: packed struct alignment [PR102068] David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).