This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: FYI: PR 7483
- 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: 13 Aug 2002 16:31:31 -0600
- Subject: Patch: FYI: PR 7483
- Reply-to: tromey at redhat dot com
I'm checking this in. This patch came from PR 7483. I agree it is
correct. I tested it against the test case in the PR, and also by
comparing the bytecode against what the Sun JDK generates (our
bytecode is a bit better :-).
Tom
Index: ChangeLog
from Jesse Rosenstock <jmr@fulcrummicro.com>
For PR java/7483:
* parse.y (build_assertion): Invert return from
desiredAssertionStatus.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.390
diff -u -r1.390 parse.y
--- parse.y 2 Jul 2002 02:56:11 -0000 1.390
+++ parse.y 13 Aug 2002 21:15:16 -0000
@@ -15353,6 +15353,12 @@
call = build (CALL_EXPR, NULL_TREE, id, NULL_TREE, NULL_TREE);
call = make_qualified_primary (classdollar, call, location);
TREE_SIDE_EFFECTS (call) = 1;
+
+ /* Invert to obtain !CLASS.desiredAssertionStatus(). This may
+ seem odd, but we do it to generate code identical to that of
+ the JDK. */
+ call = build1 (TRUTH_NOT_EXPR, NULL_TREE, call);
+ TREE_SIDE_EFFECTS (call) = 1;
DECL_INITIAL (field) = call;
/* Record the initializer in the initializer statement list. */