aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index dac6602..2a581a1 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -15353,6 +15353,12 @@ build_assertion (location, condition, value)
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. */