https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112488
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Uecker <uec...@gcc.gnu.org>: https://gcc.gnu.org/g:6cf9654c3b06c076502a39a3bf2222dd6e43b73b commit r14-6436-g6cf9654c3b06c076502a39a3bf2222dd6e43b73b Author: Martin Uecker <uec...@tugraz.at> Date: Wed Nov 15 09:22:55 2023 +0100 Fix regression causing ICE for structs with VLAs [PR 112488] A previous patch that fixed several ICEs related to size expressions of VM types (PR c/70418, ...) caused a regression for structs where a DECL_EXPR is not generated anymore although reqired. We now call add_decl_expr introduced by the previous patch from finish_struct. The function is revised with a new argument to not set the TYPE_NAME for the type to the DECL_EXPR in this specific case. PR c/112488 gcc/c * c-decl.cc (add_decl_expr): Revise. (finish_struct): Create DECL_EXPR. * c-parser.cc (c_parser_struct_or_union_specifier): Call finish_struct with expression for VLA sizes. * c-tree.h (finish_struct): Add argument. gcc/testsuite * gcc.dg/pr112488-1.c: New test. * gcc.dg/pr112488-2.c: New test. * gcc.dg/pr112898.c: New test. * gcc.misc-tests/gcov-pr85350.c: Adapt.