This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]