[Bug middle-end/97943] [11 Regression] ICE with __builtin_clear_padding on flexible array member

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 24 10:28:17 GMT 2020


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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #6)
> I think we should reject trying to clear the padding of a
> flexible/zero-length array, with error rather than sorry.  And handle an
> array at the end of a struct like any other array.  Nobody should be using
> this builtin with the struct hack, it's impossible for it to do anything
> sensible.

I agree. In the unlikely scenario somebody comes up with a good use, we can
relax it later. If we allow it now somebody will find a way to depend on it
"working" and then it's harder to remove later.


More information about the Gcc-bugs mailing list