http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46909
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-13
13:02:22 UTC ---
The fix is easy:
@@ -2441,7 +2441,7 @@ or_var_with_comparison_1 (gimple stmt,
=> (t OR inner2)
If the partial result t is a constant, we win. Otherwise
continue on to try reassociating with the other inner test. */
- if (innercode == TRUTH_OR_EXPR)
+ if (is_or)
{
if (integer_onep (t))
return boolean_true_node;
@@ -2474,7 +2474,7 @@ or_var_with_comparison_1 (gimple stmt,
/* Handle the OR case, where we are reassociating:
(inner1 OR inner2) OR (op2a code2 op2b)
=> (inner1 OR t) */
- if (innercode == TRUTH_OR_EXPR)
+ if (is_or)
{
if (integer_zerop (t))
return inner1;
(the and folder does it that way correctly). Still looking why it isn't
optimized now into x != 4.