This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Merge status 2004-05-03
- From: Andrew Haley <aph at redhat dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 7 May 2004 21:05:52 +0100
- Subject: Re: [tree-ssa] Merge status 2004-05-03
One of the Java failures is caused by this:
int y = 9;
y = y * (y = 3);
if ( y == 27 ) {
System.out.println("OK2");
}
being transformed into:
y = 9;
y = 3;
y = y * y;
if (y == 27)
{
It seems to me like the gimplify_modify_expr() logic is doing
something unexpected. I thought that the idea was just to do a
depth-first left-to-right search generating single assignment
statements as you go, creating new temporaries on the fly.
I guess the problem may trivially be solved by copying a variable
whenever we see one in an expression. Then, if that variable gets
modified later in the expression, we'll use the right value. But I
guess the problem here is that gimplify_modify_expr() doesn't generate
temporaries for values when they're used in expressions. There's no
need to do that for C...
I'm very reluctant to write a whole new gimplifier for Java, or to
start generating a ton of random temporaries in the Java front end.
Do you have any (polite) suggestions? :-)
Andrew.