Martin L's recent switch table improvements are compromising gcc.dg/pr46309-2.c on a variety of targets. They turn the series of if statements into a switch, then convert that into a relatively simple overflow test. The net result is there's nothing interesting left for tree-ssa-reassoc which is what the test is supposed to be verifying.
The right thing to do here is avoid the conversions which in turn leaves the IL in the proper state for checking tree-ssa-reassoc's behavior. I've pushed this to the trunk. Jeff
commit 968666a011b904f70d12e52180d361faaedfd3a2 Author: Jeff Law <l...@redhat.com> Date: Tue Dec 1 14:27:38 2020 -0700 Fix compromised tests after recent switch table improvements gcc/testsuite * gcc.dg/pr46309-2.c: Add -fno-bit-tests and -fno-jump-tables to avoid compromising the test. diff --git a/gcc/testsuite/gcc.dg/pr46309-2.c b/gcc/testsuite/gcc.dg/pr46309-2.c index f56df42935c..2903fff225a 100644 --- a/gcc/testsuite/gcc.dg/pr46309-2.c +++ b/gcc/testsuite/gcc.dg/pr46309-2.c @@ -1,6 +1,6 @@ /* PR tree-optimization/46309 */ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-ipa-icf -fdump-tree-reassoc-details" } */ +/* { dg-options "-O2 -fno-ipa-icf -fno-jump-tables -fno-bit-tests -fdump-tree-reassoc-details" } */ int foo (void);