if-to-switch: fix matching of negative conditions
authorMartin Liska <mliska@suse.cz>
Tue, 8 Dec 2020 12:18:37 +0000 (13:18 +0100)
committerMartin Liska <mliska@suse.cz>
Tue, 8 Dec 2020 20:02:51 +0000 (21:02 +0100)
commitf7251a2c103bc48775cb9726a4bebeaebde96684
tree1c5b090164fd7d975b75e4751e904cc750171222
parentdded5f78ccb785520804444871a7b6ca4b735370
if-to-switch: fix matching of negative conditions

gcc/ChangeLog:

PR tree-optimization/98182
* gimple-if-to-switch.cc (pass_if_to_switch::execute): Request
chain linkage through false edges only.

gcc/testsuite/ChangeLog:

PR tree-optimization/98182
* gcc.dg/tree-ssa/if-to-switch-10.c: New test.
* gcc.dg/tree-ssa/pr98182.c: New test.
gcc/gimple-if-to-switch.cc
gcc/testsuite/gcc.dg/tree-ssa/if-to-switch-10.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr98182.c [new file with mode: 0644]