Commit 560ad308 by Uros Bizjak Committed by Uros Bizjak

re PR c/52290 (internal compiler error: tree check: expected function_decl, have…

re PR c/52290 (internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712)

	PR c/52290
	* c-decl.c (start_function): Exit early if decl1 is not FUNTION_DECL.

testsuite/ChangeLog:

	PR c/52290
	* gcc.dg/noncompile/pr52290.c: New test.

From-SVN: r184511
parent f71f1418
2012-02-23 Uros Bizjak <ubizjak@gmail.com>
PR c/52290
* c-decl.c (start_function): Exit early if decl1 is not FUNTION_DECL.
2012-02-23 Georg-Johann Lay <avr@gjlay.de> 2012-02-23 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.md (code_stdname): Add ior, xor. * config/avr/avr.md (code_stdname): Add ior, xor.
......
...@@ -7702,7 +7702,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, ...@@ -7702,7 +7702,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
/* If the declarator is not suitable for a function definition, /* If the declarator is not suitable for a function definition,
cause a syntax error. */ cause a syntax error. */
if (decl1 == 0) if (decl1 == 0
|| TREE_CODE (decl1) != FUNCTION_DECL)
return 0; return 0;
loc = DECL_SOURCE_LOCATION (decl1); loc = DECL_SOURCE_LOCATION (decl1);
......
2012-02-23 Uros Bizjak <ubizjak@gmail.com>
PR c/52290
* gcc.dg/noncompile/pr52290.c: New test.
2012-02-23 Jakub Jelinek <jakub@redhat.com> 2012-02-23 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/52019 PR tree-optimization/52019
......
/* { dg-error "undeclared here" "" { target *-*-* } 3 } */
/* { dg-error "expected" "" { target *-*-* } 3 } */
int f()[j]
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