This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: Fix "PR 162" regression
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Subject: Patch: Fix "PR 162" regression
- From: Tom Tromey <tromey at redhat dot com>
- Date: 14 Mar 2001 19:15:10 -0700
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Reply-To: tromey at redhat dot com
The PR162.java test case fails now, even though the original PR was
fixed a long time ago.
The problem was that we weren't generating a <clinit> in all the
relevant cases. In particular we weren't generating one if the
<clinit> had a MODIFY_EXPR whose second operand was not constant.
This patch fixes the problem. I tested it by rebuilding libgcj and
then running `make check'. There were no regressions.
Ok?
2001-03-14 Tom Tromey <tromey@redhat.com>
* parse.y (analyze_clinit_body): Return true if the second operand
of a METHOD_EXPR is nonzero.
Tom
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.251.2.6
diff -u -r1.251.2.6 parse.y
--- parse.y 2001/02/20 21:15:48 1.251.2.6
+++ parse.y 2001/03/15 01:57:28
@@ -7588,7 +7588,7 @@
}
/* Analyzes a method body and look for something that isn't a
- MODIFY_EXPR. */
+ MODIFY_EXPR with a constant value. */
static int
analyze_clinit_body (bbody)
@@ -7612,11 +7612,10 @@
break;
case MODIFY_EXPR:
- bbody = NULL_TREE;
- break;
+ /* Return 0 if the operand is constant, 1 otherwise. */
+ return ! TREE_CONSTANT (TREE_OPERAND (bbody, 1));
default:
- bbody = NULL_TREE;
return 1;
}
return 0;