This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [REPOST] Invalid Code when reading from unaligned zero-sized array
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Bernd Edlinger <bernd dot edlinger at hotmail dot de>, Richard Biener <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Sat, 07 Dec 2013 12:31:27 +0100
- Subject: Re: [REPOST] Invalid Code when reading from unaligned zero-sized array
- Authentication-results: sourceware.org; auth=none
- References: <DUB122-W20B5CD3C7B50824A33E21AE4D50 at phx dot gbl> <52A240CA dot 4040904 at redhat dot com> <5897284 dot r5JpveH9KC at polaris>
> That being said, the concern is certainly valid so we may want to go for a
> kludge instead of the fix. The point is that the kludge should do exactly
> what the fix would have done in the RTL expander and nothing more; it's out
> of question to pessimize all the other languages and all the other cases in
> the C family of languages for highly artificial testcases using
> non-portable code.
What about:
1. a new boolean language hook support_trailing_arrays,
2. a new flag on RECORD_OR_UNION_TYPE_P types,
3. modifying stor-layout.c so that it sets the new flag on the appropriate
types when support_trailing_arrays is true,
4. modifying expr.c along the lines of Bernd's latest idea to avoid returning
anything but a MEM for objects with a type on which the flag is set?
--
Eric Botcazou