This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PR java/16927 [Was Re: PATCH for better assertion control.]
- 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: Thu, 23 Sep 2004 19:03:46 +0100
- Subject: Re: PR java/16927 [Was Re: PATCH for better assertion control.]
- References: <40526AED.6070807@bothner.com><40538F72.5030905@bothner.com><16723.2273.470478.699815@cuddles.cambridge.redhat.com><m3llf028i4.fsf@localhost.localdomain><16723.2863.133512.195928@cuddles.cambridge.redhat.com>
Disabling assertions caused an ICE if the body of the assertion was a
string concatenation.
Andrew.
2004-09-23 Andrew Haley <aph@redhat.com>
PR java/16927:
* parse.y (java_complete_lhs): Call patch_string() on Operand 1 of
COND_EXPRs.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.506
diff -p -2 -c -w -r1.506 parse.y
*** parse.y 22 Sep 2004 10:51:42 -0000 1.506
--- parse.y 23 Sep 2004 18:01:07 -0000
*************** java_complete_lhs (tree node)
*** 11648,11651 ****
--- 11648,11660 ----
if (TREE_OPERAND (node, 1) == error_mark_node)
return error_mark_node;
+ {
+ /* This is a special case due to build_assertion(). When
+ assertions are disabled we build a COND_EXPR in which
+ Operand 1 is the body of the assertion. If that happens to
+ be a string concatenation we'll need to patch it here. */
+ tree patched = patch_string (TREE_OPERAND (node, 1));
+ if (patched)
+ TREE_OPERAND (node, 1) = patched;
+ }
TREE_OPERAND (node, 2) = java_complete_tree (TREE_OPERAND (node, 2));
if (TREE_OPERAND (node, 2) == error_mark_node)