]> gcc.gnu.org Git - gcc.git/commit
Copy EH phi args for throwing hardened compares
authorAlexandre Oliva <oliva@adacore.com>
Fri, 25 Feb 2022 01:03:32 +0000 (22:03 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 25 Feb 2022 01:03:32 +0000 (22:03 -0300)
commite53bb1965db9c7882ded4a70296340d8db52053a
tree344b592f8562c46ed3e888a2212d28e86b8203b7
parent756a61851c11ffb6b5bcc21f147f6f102bf8e1f3
Copy EH phi args for throwing hardened compares

When we duplicate a throwing compare for hardening, the EH edge from
the original compare gets duplicated for the inverted compare, but we
failed to adjust any PHI nodes in the EH block.  This patch adds the
needed adjustment, copying the PHI args from those of the preexisting
edge.

for  gcc/ChangeLog

PR tree-optimization/103856
* gimple-harden-conditionals.cc (non_eh_succ_edge): Enable the
eh edge to be requested through an extra parameter.
(pass_harden_compares::execute): Copy PHI args in the EH dest
block for the new EH edge added for the inverted compare.

for  gcc/testsuite/ChangeLog

PR tree-optimization/103856
* g++.dg/pr103856.C: New.
gcc/gimple-harden-conditionals.cc
gcc/testsuite/g++.dg/pr103856.C [new file with mode: 0644]
This page took 0.060863 seconds and 6 git commands to generate.