This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: PR java/8712
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 19 Dec 2002 22:04:55 -0700
- Subject: Patch: PR java/8712
- Reply-to: tromey at redhat dot com
This patch fixes PR java/8712.
Instead of generating an incorrect COND_EXPR (which causes an abort in
fold-const), we now generate a valid NE_EXPR.
Test on x86 Red Hat Linux 7.3.
Ok to commit? I want to put it on the trunk and the 3.3 branch.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
Fix for PR java/8712:
* expr.c (build_instanceof): Build an NE_EXPR, not a COND_EXPR,
when simply checking against `null'.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.154
diff -u -r1.154 expr.c
--- expr.c 16 Dec 2002 18:22:32 -0000 1.154
+++ expr.c 20 Dec 2002 03:48:26 -0000
@@ -1257,9 +1257,7 @@
/* Anything except `null' is an instance of Object. Likewise,
if the object is known to be an instance of the class, then
we only need to check for `null'. */
- expr = build (COND_EXPR, itype,
- value,
- boolean_true_node, boolean_false_node);
+ expr = build (NE_EXPR, itype, value, null_pointer_node);
}
else if (! TYPE_ARRAY_P (type)
&& ! TYPE_ARRAY_P (valtype)