Jakub spotted this wart in my last change.    We have already tested
that we do not have 0 or 1 ops.  So != 2 is more clearly written as > 2.

Bootstrapped and regression tested on x86_64.  Committed to the trunk.

Jeff
commit 04acc76e9d46299f5251bf9f495d1b7688d7907f
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Oct 13 19:12:05 2017 +0000

            * tree-ssa-reassoc.c (reassociate_bb): Clarify code slighly.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253740 
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b593718fa6f..56383ef72f0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-13  Jeff Law  <l...@redhat.com>
+
+       * tree-ssa-reassoc.c (reassociate_bb): Clarify code slighly.
+
 2017-10-13  Jakub Jelinek  <ja...@redhat.com>
 
        PR target/82274
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index cc57ae320a3..e0e64e16eba 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -5910,7 +5910,7 @@ reassociate_bb (basic_block bb)
                     move it to the front.  This helps ensure that we generate
                     (X & Y) & C rather than (X & C) & Y.  The former will
                     often match a canonical bit test when we get to RTL.  */
-                 if (ops.length () != 2
+                 if (ops.length () > 2
                      && (rhs_code == BIT_AND_EXPR
                          || rhs_code == BIT_IOR_EXPR
                          || rhs_code == BIT_XOR_EXPR)

Reply via email to