This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/66661] incorrect memory access in optimization with flexible array member
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Jun 2015 17:13:34 +0000
- Subject: [Bug middle-end/66661] incorrect memory access in optimization with flexible array member
- Auto-submitted: auto-generated
- References: <bug-66661-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66661
--- Comment #10 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Thu, 25 Jun 2015, P at draigBrady dot com wrote:
> I'm not understanding completely TBH. Are flexible array members not special?
> Should the optimizations be restricted on access through the flexible array,
> because I presume most/all existing allocation code is not considering this
> alignment/padding issue. I certainly didn't notice any examples when looking
> into a workaround which I came up with independently. For my reference there
> are some notes RE GCC's divergence from C99 re padding and flexi arrays at:
> https://sites.google.com/site/embeddedmonologue/home/c-programming/data-alig
That page doesn't exist - I assume you mean:
https://sites.google.com/site/embeddedmonologue/home/c-programming/data-alignment-structure-padding-and-flexible-array-member
That page is over ten years out of date - it's quoting the wording in C99
as it was before it was corrected by TC2 (published 2004-11-15). You
should look at the post-TC2 wording rather than the old wording with
various defects in it.