This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/66337] __alignof__(s.d) incorrect for a double member with -malign-power


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66337

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2016-02-18
                 CC|                            |dje at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #4 from David Edelsohn <dje at gcc dot gnu.org> ---
I don't understand this bug report.  AIX does not use natural alignment because
the AIX ABI was created before "long long" existed and the team chose to not
create a larger alignment only for "double".  When the team realized the
mistake, they retrofitted the ABI to allow stricter alignment where the freedom
still existed -- singleton double and structures where double is the first
element (so the entire structure could transparently be aligned more strictly).

When ELF support was added to the rs6000 port, some customers wanted AIX
compatibility.  Support was added for ELF with and without function descriptors
and with and without AIX alignment.  -malign=power enables AIX-style alignment
for ELF.

The bug seems to be in the output of GCC builtin __alignof__.  How can a single
element member of a structure have weaker alignment, in reality, than the
structure itself?

The rs6000 port bumped the alignment of the structure but GCC still believes
that the element itself has the default alignment.  XLC correctly reports the
stricter interior alignment of the element.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]