[Bug middle-end/59711] ICE in force_constant_size, at gimplify.c:619 with variably-modified return type
ebotcazou at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 8 12:11:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59711
--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I believe this isn't fixable with the GIMPLE IL as-is - without lowering
> to the fact that g () returns by storing to a return slot. Not sure why
> 3.4 ICEd (2.95.2 also ICEs btw ...).
Because historically you cannot create temporaries with variable size in GCC.
> Well, maybe we can fix it if we allow creating of a variable-size temporary
> during gimplification. That is, the gimple code needs to look like
>
> tem = WITH_SIZE_EXPR <g (), sizeof (S)>;
> return tem.a[0];
>
> which of course then has the issue that we can't have WITH_SIZE_EXPR around
> calls. Thus really the only way is to lower the return slot fact early.
>
> g (&tem);
> return tem.a[0];
Of course this situation occurs very frequently in Ada and we explicitly create
the temporary in gigi.
More information about the Gcc-bugs
mailing list