]> 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:03:33 +0000 (19:03 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 23 Feb 2012 18:03:33 +0000 (19:03 +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: r184518

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

index ffa152a24a1877bed13dee9de2bd4840d6d9e61f..512a12edd38b3f4f5db0925614462ad0ed33149e 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 4d3e628f5ee93a97af8ca477158fb33e43423a08..f2ba359901f831a8b21f7bc9c7139aecc7cce216 100644 (file)
@@ -6136,7 +6136,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)
     {
       label_context_stack_se = label_context_stack_se->next;
       label_context_stack_vm = label_context_stack_vm->next;
index 35e1b386825e72790b4fbf47bf0ab0dbbae9a464..8ef7c5abcb0294324b47f57e1595dd5840f4af4c 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]