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
This commit is contained in:
Steven Bosscher 2003-07-24 08:58:42 +00:00
parent acd0b319f1
commit 8f5b6d29fb
4 changed files with 27 additions and 0 deletions

View File

@ -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

View File

@ -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)))

View File

@ -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

View File

@ -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;
}