[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining since r12-5338-g4e6bf0b9dd5585df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 --- Comment #8 from Martin Uecker --- https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611562.html
[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining since r12-5338-g4e6bf0b9dd5585df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 --- Comment #7 from Martin Uecker --- * gimplify_type_size does not recurse into pointer, record, or function types (the later are not mentioned). * the C FE has code to emit fake TYPE_DECLs for pointer types in c-decl.cc/grokdeclarator * In the FE, size expressions in parameters go into pending_sizes and emitted at a start of a function c-decl.cc/store_parm_decls * function.cc/gimplify_parm_type only considers types with non-constant size and otherwise recurses only into pointer types How all this fits together is a bit of mystery to me. Modifying gimplify_parm_type to also recurse into function types seems to fix this bug (and PR107557) but I am not sure if this is the right fix. Then there should also be similar missing cases related to records/unions?
[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining since r12-5338-g4e6bf0b9dd5585df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 --- Comment #6 from Martin Uecker --- Actually, I meant PR84305 for C.
[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining since r12-5338-g4e6bf0b9dd5585df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 --- Comment #5 from Martin Uecker --- Probably related to PR88256
[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining since r12-5338-g4e6bf0b9dd5585df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 --- Comment #4 from Martin Uecker --- The specific problem is triggered by the change to pointer_int_sum in gcc/c-family/c-common.cc, but the underlying problem is older. The following example fails since gcc 7: void f(int n, int (*a(void))[n]) { sizeof (*a()); } int (*a(void))[1]; void g(void) { f(1, a); } https://godbolt.org/z/645ahfrzx
[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining since r12-5338-g4e6bf0b9dd5585df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 --- Comment #3 from Martin Uecker --- Smaller example: void f(int n, int (*a(void))[n]) { (a())[0]; } void g(void) { int (*a(void))[1]; f(1, a); }
[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining since r12-5338-g4e6bf0b9dd5585df
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 Martin Liška changed: What|Removed |Added Summary|[12/13 Regression] ICE in |[12/13 Regression] ICE in |make_ssa_name_fn with VLA |make_ssa_name_fn with VLA |types in arguments and |types in arguments and |inlining|inlining since ||r12-5338-g4e6bf0b9dd5585df CC||marxin at gcc dot gnu.org, ||muecker at gwdg dot de --- Comment #2 from Martin Liška --- Started with r12-5338-g4e6bf0b9dd5585df.
[Bug c/108423] [12/13 Regression] ICE in make_ssa_name_fn with VLA types in arguments and inlining
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423 Richard Biener changed: What|Removed |Added Component|middle-end |c Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Priority|P3 |P2 Last reconfirmed||2023-01-17 --- Comment #1 from Richard Biener --- #3 0x01697500 in remap_ssa_name (name=, id=0x7fffd910) at /home/rguenther/src/trunk/gcc/tree-inline.cc:237 237 new_tree = make_ssa_name (remap_type (TREE_TYPE (name), id)); (gdb) p debug_tree (name) nothrow def_stmt version:1 in-free-list> $1 = void so another case with a missing/misplaced DECL_EXPR for the VLA size.