This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PR java/27025: ICE on simple initializer
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Apr 2006 17:27:03 +0100
- Subject: PR java/27025: ICE on simple initializer
gcj assumes that in the operation (A + B), where A and B are
constants, the result must be a constant. It ain't necessaarily so.
Andrew.
2006-04-04 Andrew Haley <aph@redhat.com>
PR java/27025
* parse.y (fold_constant_for_init): Make sure the result of
folding a binop really is a constant.
Index: java/parse.y
===================================================================
--- java/parse.y (revision 112663)
+++ java/parse.y (working copy)
@@ -16295,7 +16295,10 @@
if (val == NULL_TREE || ! TREE_CONSTANT (val))
return NULL_TREE;
TREE_OPERAND (node, 1) = val;
- return patch_binop (node, op0, op1, 1);
+ val = patch_binop (node, op0, op1, 1);
+ if (! TREE_CONSTANT (val))
+ return NULL_TREE;
+ return val;
case UNARY_PLUS_EXPR:
case NEGATE_EXPR: