Skip to content
Snippets Groups Projects
Commit 6cf9654c authored by Martin Uecker's avatar Martin Uecker
Browse files

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.
parent 453e0f45
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment