This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14669] [3.4/3.5 Regression] Wrong code with -O for enum values expression E4 <= t && t <= E6
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Mar 2004 15:53:10 -0000
- Subject: [Bug optimization/14669] [3.4/3.5 Regression] Wrong code with -O for enum values expression E4 <= t && t <= E6
- References: <20040321141018.14669.wanderer@rsu.ru>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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