Commit f4b7e754 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/89045 (ICE in get_parm_info, at c/c-decl.c:7518)

	PR c/89045
	* c-decl.c (build_compound_literal): Don't pushdecl if in parameter
	scope.

	* gcc.dg/pr89045.c: New test.

From-SVN: r268349
parent 6a335b96
2019-01-29 Jakub Jelinek <jakub@redhat.com>
PR c/89045
* c-decl.c (build_compound_literal): Don't pushdecl if in parameter
scope.
PR c/86125
* c-decl.c (last_fileptr_type): Remove.
(last_structptr_types): New variable.
......
......@@ -5528,7 +5528,7 @@ build_compound_literal (location_t loc, tree type, tree init, bool non_const,
pushdecl (decl);
rest_of_decl_compilation (decl, 1, 0);
}
else if (current_function_decl)
else if (current_function_decl && !current_scope->parm_flag)
pushdecl (decl);
if (non_const)
......
2019-01-29 Jakub Jelinek <jakub@redhat.com>
PR c/89045
* gcc.dg/pr89045.c: New test.
PR c/86125
* gcc.dg/Wbuiltin-declaration-mismatch-7.c: Guard testcase for
lp64, ilp32 and llp64 only.
......
/* PR c/89045 */
/* { dg-do compile } */
/* { dg-options "" } */
int
foo (int x)
{
int v[(int){ x }];
v[0] = 0;
int bar (int p[(int){ x }])
{
return p[0];
}
return bar (v);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment