This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for PR gcj/268
- To: apbianco at redhat dot com
- Subject: Re: Patch for PR gcj/268
- From: Tom Tromey <tromey at creche dot cygnus dot com>
- Date: 25 Jun 2000 16:38:47 -0600
- Cc: tromey at cygnus dot com, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- References: <871z1lejwj.fsf@creche.i-did-not-set--mail-host-address--so-shoot-m\e> <14678.18937.807147.144588@deliverance.cygnus.com>
>> Here is an updated version of my patch for PR gcj/268. I'm still
>> not convinced this is the correct patch, and it does feel rather
>> hacky to me.
Alex> Alternatively, one could build a WFL around it.
Works for me. How about this patch?
2000-06-25 Tom Tromey <tromey@cygnus.com>
* parse.y (for_statement): Wrap expression in a WFL if it is a
constant. For PR gcj/268.
Tom
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.181
diff -u -r1.181 parse.y
--- parse.y 2000/06/25 17:28:35 1.181
+++ parse.y 2000/06/25 22:30:33
@@ -1631,7 +1631,11 @@
for_statement:
for_begin SC_TK expression SC_TK for_update CP_TK statement
- { $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7); }
+ {
+ if (TREE_CODE_CLASS (TREE_CODE ($3)) == 'c')
+ $3 = build_wfl_node ($3);
+ $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7);
+ }
| for_begin SC_TK SC_TK for_update CP_TK statement
{
$$ = finish_for_loop (0, NULL_TREE, $4, $6);