Hi The patch reassociates X == CST1 || X == CST2 if popcount (CST2 - CST1) == 1 into ((X - CST1) & ~(CST2 - CST1)) == 0.
Bootstrap on x86-64 and ARM chromebook. No make check regression on x86-64 and panda board. For some targets/options, the "(X == CST1 || X == CST2)" might be converted to "if (x == CST1) else if (x == CST2)" at the beginning. In such case, the patch will not be executed. It is hard to write a reliable testcase to detect the transformation. So the testcase does not check the dump logs from reassoc1 pass. It just checks the runtime result. Is it OK for trunk? Thanks! -Zhenqiang ChangeLog 2013-08-05 Zhenqiang Chen <zhenqiang.c...@arm.com> * tree-ssa-reassoc.c (optimize_range_tests): Reasociate X == CST1 || X == CST2 if popcount (CST2 - CST1) == 1 into ((X - CST1) & ~(CST2 - CST1)) == 0. testsuite/ChangeLog 2013-08-05 Zhenqiang Chen <zhenqiang.c...@arm.com> * gcc.dg/reassoc1.c: New testcase.
reassociate.patch
Description: Binary data