[Bug c/63880] GCC overoptimization on local arrays of size 1

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 17 09:42:00 GMT 2014


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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Indeed this is a case we don't handle as QOI special-case (we accept other
cases of strictly undefined code though).

In this case it is recommended to just do

arglist *p = malloc (sizeof (arglist) + sizeof (char *) * 1000);

and as Andrew said not wrap arglist inside another struct which appends a
member.



More information about the Gcc-bugs mailing list