]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/52290 (internal compiler error: tree check: expected function_decl, have...
authorUros Bizjak <ubizjak@gmail.com>
Thu, 23 Feb 2012 18:01:45 +0000 (19:01 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 23 Feb 2012 18:01:45 +0000 (19:01 +0100)
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: r184517

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/noncompile/pr52290.c [new file with mode: 0644]

index 22e48889e13d2d20d9d2ea62a227c550f6219324..230c266a8b525587e30fd950d0cd97ff31014172 100644 (file)
@@ -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-22  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/52330
index abb4bdeee2af0143d2974c31f99b1ae6901c6949..3fb2f173e6fece5c8219fe144c63f831a217739d 100644 (file)
@@ -7385,7 +7385,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);
index bdf80bcc8dc60e1c95daa58356f20fd61ea4e635..b89bd70ab088a1e30f648e18194f1d5814fdb5fa 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-23  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR c/52290
+       * gcc.dg/noncompile/pr52290.c: New test.
+
 2012-02-22  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/52330
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr52290.c b/gcc/testsuite/gcc.dg/noncompile/pr52290.c
new file mode 100644 (file)
index 0000000..275543c
--- /dev/null
@@ -0,0 +1,3 @@
+/* { dg-error "undeclared here" "" { target *-*-* } 3 } */
+/* { dg-error "expected" "" { target *-*-* } 3 } */
+int f()[j]