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

--- Comment #8 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> 
---
(In reply to Jakub Jelinek from comment #7)
> In patch form what I wrote above (completely untested):
Sorry in advance for the overly verbose comment, but the timeline here was
that:

- PR108411 fixed an ABI problem exposed by struct-layout-1 trying something
new.

- The fix for PR108411 also included some extra asserts to try to prevent
similar such problems being silent failures in future.

- The breakage in PR108910 was caused by the extra asserts rather than the
change in behaviour (which meant that the asserts were doing their job :)).  I
think it would be possible to construct a wrong-code bug for GCC 11 based on
this.

- The fix for PR108910 handled that case, but in a way that is intended to be
backwards-compatible, since the bug was really an internal inconsistency rather
than a specification vs. implementation discrepancy.

- The fix for PR108910 also included extra asserts, because I can't help
myself.

- This PR was again caused by the extra asserts, rather than by the code
change.

My laboured point being, it's only really the first bullet point that is (or
was intended to be) a change in the implemented ABI.  Otherwise we've tried to
keep the implementation (and implementation method) the same as far as
possible.  The extra asserts are just to make sure that we know what's going
on.

Because of that, I'm wary of changing the general way that we calculate the
alignment.  These asserts have been firing because of unexpected corner cases. 
At least as things stand, we'll err on the side of doing what earlier compilers
did in the face of those corner cases, including those where TYPE_USER_ALIGN is
set.

Reply via email to