[PR103024,PR103530] support throwing compares and non-boolean types
authorAlexandre Oliva <oliva@adacore.com>
Thu, 9 Dec 2021 02:37:09 +0000 (23:37 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 9 Dec 2021 02:37:09 +0000 (23:37 -0300)
commit2bff91f3b4e6f697823a261222186f4b5b052e86
treecba13c4bcd310347f5c0722bd0e19077adaea3b0
parent641ff2196fe3909bba852a5ac1d55e7cdab6d361
[PR103024,PR103530] support throwing compares and non-boolean types

This patch adjusts the harden-compares pass to cope with compares that
end basic blocks, and to accept non-boolean integral types whose
conversion to boolean may have been discarded.

for  gcc/ChangeLog

PR tree-optimization/103024
PR middle-end/103530
* gimple-harden-conditionals.cc (non_eh_succ_edge): New.
(pass_harden_compares::execute): Accept 1-bit integral types,
and cope with throwing compares.

for  gcc/testsuite/ChangeLog

PR tree-optimization/103024
PR middle-end/103530
* g++.dg/pr103024.C: New.
* g++.dg/pr103530.C: New.
gcc/gimple-harden-conditionals.cc
gcc/testsuite/g++.dg/pr103024.C [new file with mode: 0644]
gcc/testsuite/g++.dg/pr103530.C [new file with mode: 0644]