diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2012-02-23 17:34:02 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2012-02-23 17:34:02 +0100 |
commit | 560ad30812da70455b371b0488229beab9ae9d75 (patch) | |
tree | 775525bc6d105a76e8dd7954fe595270b2fc3544 | |
parent | f71f1418cf5d50077cba55eaa2abfe843957c78a (diff) | |
download | gcc-560ad30812da70455b371b0488229beab9ae9d75.zip gcc-560ad30812da70455b371b0488229beab9ae9d75.tar.gz gcc-560ad30812da70455b371b0488229beab9ae9d75.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/noncompile/pr52290.c | 3 |
4 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a144fcd..6a747c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> * config/avr/avr.md (code_stdname): Add ior, xor. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 93fb16d..de46578 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -7702,7 +7702,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, /* 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 084ab6c..a3513e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR tree-optimization/52019 diff --git a/gcc/testsuite/gcc.dg/noncompile/pr52290.c b/gcc/testsuite/gcc.dg/noncompile/pr52290.c new file mode 100644 index 0000000..275543c --- /dev/null +++ b/gcc/testsuite/gcc.dg/noncompile/pr52290.c @@ -0,0 +1,3 @@ +/* { dg-error "undeclared here" "" { target *-*-* } 3 } */ +/* { dg-error "expected" "" { target *-*-* } 3 } */ +int f()[j] |