This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Feb 2012 23:24:07 +0000
- Subject: [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
- Auto-submitted: auto-generated
- References: <bug-52290-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52290
--- Comment #2 from Uros Bizjak <ubizjak at gmail dot com> 2012-02-22 23:24:07 UTC ---
How about:
Index: c-decl.c
===================================================================
--- c-decl.c (revision 184492)
+++ c-decl.c (working copy)
@@ -7702,7 +7702,8 @@ start_function (struct c_declspecs *declspecs, str
/* If the declarator is not suitable for a function definition,
cause a syntax error. */
- if (decl1 == 0)
+ if (decl1 == 0
+ || TREE_CODE (decl1) != FUNCTION_DECL)
return 0;
loc = DECL_SOURCE_LOCATION (decl1);