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.