This is the mail archive of the gcc-bugs@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]

[Bug optimization/14669] [3.4/3.5 Regression] Wrong code with -O for enum values expression E4 <= t && t <= E6


------- Additional Comments From kazu at cs dot umass dot edu  2004-03-22 15:52 -------
Roger,

Thank you very much for following up on my incomplete patches.

One small thing I've noticed is that the outer scope has a rather long chain
of "else if".  For the chain to work correctly, whenever you notice an
optimization opportunity with "if (...)", you have to take the opportunity.
In other words, you cannot have something like this:

else if (condition)
  {
    if (more condition)
      return blah;   
  }

because those "if"s later in the chain may be applicable to the expression
you are currently looking at.

It turns out that in this particular case, the above issue does not matter
because you are checking that TREE_CODE (arg0) == NOP_EXPR, and none of the
optimizations later in the chain are not applicable when
TREE_CODE (arg0) == NOP_EXPR.

I will submit a patch to address this issue for mainline.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14669


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