[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 --- Comment #7 from joseph at codesourcery dot com --- Passing a variable-size struct or union by value to a non-nested function seems very questionable (the function couldn't be declared with a matching prototype), but perhaps that doesn't answer the question because the cast-to-union case might appear for a nested function as well.
[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 --- Comment #6 from Jakub Jelinek --- Fixed the error-recovery bug on the trunk, but the ice on the #c4 testcase is still there (and the question is if it is valid or not). If it is valid, probably the FE or gimplifier needs to turn that cast to VLA union into creation of a VLA temporary and assigning the cast operand into the right field of it.
[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:c6a562de88c44a555e1688c212869b20b02151bc commit r10-7438-gc6a562de88c44a555e1688c212869b20b02151bc Author: Jakub Jelinek Date: Sat Mar 28 10:30:31 2020 +0100 c: After issuing errors about array size, for error-recovery don't make the array VLA [PR93573] After we report various errors about array size, we set for error-recovery the size to be 1, but because size_int_const is false, it still means we pretend the array is a VLA, can emit a second diagnostics in that case etc. E.g. $ ./cc1.unpatched -quiet a.c a.c:1:5: error: size of array âfâ has non-integer type 1 | int f[100.0]; | ^ a.c:1:1: warning: variably modified âfâ at file scope 1 | int f[100.0]; | ^~~ $ ./cc1 -quiet a.c a.c:1:5: error: size of array âfâ has non-integer type 1 | int f[100.0]; | ^ 2020-03-28 Jakub Jelinek PR c/93573 * c-decl.c (grokdeclarator): After issuing errors, set size_int_const to true after setting size to integer_one_node. * gcc.dg/pr93573-1.c: New test. * gcc.dg/pr93573-2.c: New test.
[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 --- Comment #4 from Jakub Jelinek --- Created attachment 48135 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48135=edit gcc10-pr93573.patch For the error-recovery ICE, we can just make sure that after errors the type isn't assumed to be VLA. Unfortunately: void bar (); void foo (char a, int b) { union C { int d[b]; char *e; }; bar ((union C) ); } still ICEs.
[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 Jakub Jelinek changed: What|Removed |Added Priority|P4 |P2
[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Reduced testcase: void bar (); void foo (char a) { union C { int d[100.0]; char *e; }; bar ((union C) ); }
[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 Richard Biener changed: What|Removed |Added Target Milestone|--- |8.5 Priority|P3 |P4
[Bug c/93573] [8/9/10 Regression] internal compiler error: in force_constant_size, at gimplify.c:733
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93573 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2020-02-13 CC||msebor at gcc dot gnu.org Known to work||7.3.0 Summary|internal compiler error: in |[8/9/10 Regression] |force_constant_size, at |internal compiler error: in |gimplify.c:733 |force_constant_size, at ||gimplify.c:733 Ever confirmed|0 |1 Known to fail||10.0, 8.3.0, 9.2.0 --- Comment #2 from Martin Sebor --- Confirmed. Bisection points to r256748 (GCC 8): commit 47c268c4b27782717fbccec5019e0cd97d005afb Author: Jakub Jelinek Date: Tue Jan 16 16:18:24 2018 +0100 re PR libgomp/83590 ([nvptx] openacc reduction C regressions) PR libgomp/83590 * gimplify.c (gimplify_one_sizepos): For is_gimple_constant (expr) return early, inline manually is_gimple_sizepos. Make sure if we call gimplify_expr we don't end up with a gimple constant. * tree.c (variably_modified_type_p): Don't return true for is_gimple_constant (_t). Inline manually is_gimple_sizepos. * gimplify.h (is_gimple_sizepos): Remove. Co-Authored-By: Richard Biener From-SVN: r256748