aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2003-07-24 08:58:42 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2003-07-24 08:58:42 +0000
commit8f5b6d29fbb19a81600a32f7524103890c895369 (patch)
tree7c9f32a2255ffadbd8832a8a8b3084c2bb4fc7d6
parentacd0b319f1a5718d5a17378734ac957c7ab2f2ee (diff)
downloadgcc-8f5b6d29fbb19a81600a32f7524103890c895369.zip
gcc-8f5b6d29fbb19a81600a32f7524103890c895369.tar.gz
gcc-8f5b6d29fbb19a81600a32f7524103890c895369.tar.bz2
re PR c/10602 (ICE in c-typeck.c (tree check failure))
PR c/10602 * c-typeck.c (type_lists_compatible_p): Do not compare arguments if one of them is an error_mark_node. * gcc.dg/noncompile/incomplete-2.c: New test. From-SVN: r69735
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-typeck.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/incomplete-2.c12
4 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d19ae2d..335ee18 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-07-24 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c/10602
+ * c-typeck.c (type_lists_compatible_p): Do not compare
+ arguments if one of them is an error_mark_node
+
2003-07-24 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000.c (rs6000_emit_prologue): Save fp regs inline
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 1fea1c5..922cda8 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -860,6 +860,10 @@ type_lists_compatible_p (tree args1, tree args2, int flags)
if (c_type_promotes_to (TREE_VALUE (args1)) != TREE_VALUE (args1))
return 0;
}
+ /* If one of the lists has an error marker, ignore this arg. */
+ else if (TREE_CODE (TREE_VALUE (args1)) == ERROR_MARK
+ || TREE_CODE (TREE_VALUE (args2)) == ERROR_MARK)
+ ;
else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)),
TYPE_MAIN_VARIANT (TREE_VALUE (args2)),
flags)))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1e703c1..4881e5a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-23 Steven Bosscher <steven@gcc.gnu.org>
+
+ PR c/10602
+ * gcc.dg/noncompile/incomplete-2.c: New test.
+
2003-07-23 Mark Mitchell <mark@codesourcery.com>
PR c++/11645
diff --git a/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c b/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c
new file mode 100644
index 0000000..19864b9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c
@@ -0,0 +1,12 @@
+/* Origin: <steven@gcc.gnu.org>
+ Make sure we do not ICE when the type in the function
+ argument list is incomplete (Bug 10602). */
+/* { dg-options "-w" } */
+
+int g95_type_for_mode (enum machine_mode);
+
+int
+g95_type_for_mode (enum machine_mode mode)
+{ /* { dg-error "has incomplete type" } */
+ return 0;
+}