This is the mail archive of the gcc-patches@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]

Re: [REPOST] Invalid Code when reading from unaligned zero-sized array


> 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


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