expr.c (do_store_flag): Don't crash if either side of a comparison is error_mark_node.
authorAndrew Haley <aph@cygnus.co.uk>
Tue, 24 Oct 2000 20:06:13 +0000 (20:06 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Tue, 24 Oct 2000 20:06:13 +0000 (20:06 +0000)
2000-10-24  Andrew Haley  <aph@cygnus.co.uk>

        * expr.c (do_store_flag): Don't crash if either side of a
        comparison is error_mark_node.

From-SVN: r37036

gcc/ChangeLog
gcc/expr.c

index 67586d8a703e47f832705a5899c58ab6f0cca902..729e8899f0f9effef0603af78c1c8355b85ccca5 100644 (file)
@@ -1,3 +1,8 @@
+2000-10-24  Andrew Haley  <aph@cygnus.co.uk>
+
+       * expr.c (do_store_flag): Don't crash if either side of a
+       comparison is error_mark_node.
+
 2000-10-24  Jakub Jelinek  <jakub@redhat.com>
 
        * sibcall.c (purge_mem_unchanging_flag): New function.
index b030c7a0c29dfe29e0795e5b484a7ed5b711b0bd..06aebb6ee8c66bb3a1c4bc770a165027de81affb 100644 (file)
@@ -10133,6 +10133,11 @@ do_store_flag (exp, target, mode, only_cheap)
 
   arg0 = TREE_OPERAND (exp, 0);
   arg1 = TREE_OPERAND (exp, 1);
+
+  /* Don't crash if the comparison was erroneous.  */
+  if (arg0 == error_mark_node || arg1 == error_mark_node)
+    return const0_rtx;
+
   type = TREE_TYPE (arg0);
   operand_mode = TYPE_MODE (type);
   unsignedp = TREE_UNSIGNED (type);