]> git.ipfire.org Git - thirdparty/gcc.git/commit
if-to-switch: Don't skip the first condition bb when find_conditions in if-to-switch...
authorXionghu Luo <xionghuluo@tencent.com>
Thu, 9 Jun 2022 07:46:30 +0000 (15:46 +0800)
committerXionghu Luo <xionghuluo@tencent.com>
Tue, 21 Jun 2022 09:26:45 +0000 (17:26 +0800)
commit57424087e82db140c06d4ea73f9700d5291c5bc2
treed4591e9522d7914d858507e0cf678a3bc18530ab
parent70454c50b4592fe6876ecca13268264e395e058f
if-to-switch: Don't skip the first condition bb when find_conditions in if-to-switch [PR105740]

The if condition is at last of first bb, so side effect statement in first BB
doesn't matter, then the first if condition could also be folded to switch
table.

gcc/ChangeLog:

PR target/105740
* gimple-if-to-switch.cc (find_conditions): Don't skip the first
condition bb.

gcc/testsuite/ChangeLog:

PR target/105740
* gcc.dg/tree-ssa/if-to-switch-11.c: New test.

Signed-off-by: Xionghu Luo <xionghuluo@tencent.com>
gcc/gimple-if-to-switch.cc
gcc/testsuite/gcc.dg/tree-ssa/if-to-switch-11.c [new file with mode: 0644]