diff options
author | Richard Biener <rguenther@suse.de> | 2022-04-14 14:06:22 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-04-25 09:25:33 +0200 |
commit | 4f77738c3b44cb6b7bfe2a7ef823a5d9d75c0e79 (patch) | |
tree | ade51b6bef8f3501aa2b7e14fd056f0d205697bd /libphobos/libdruntime | |
parent | 3c940d42701707559fabe49be99296f60fbc43e7 (diff) | |
download | gcc-4f77738c3b44cb6b7bfe2a7ef823a5d9d75c0e79.zip gcc-4f77738c3b44cb6b7bfe2a7ef823a5d9d75c0e79.tar.gz gcc-4f77738c3b44cb6b7bfe2a7ef823a5d9d75c0e79.tar.bz2 |
rtl-optimization/105231 - distribute_notes and REG_EH_REGION
The following mitigates a problem in combine distribute_notes which
places an original REG_EH_REGION based on only may_trap_p which is
good to test whether a non-call insn can possibly throw but not if
actually it does or we care. That's something we decided at RTL
expansion time where we possibly still know the insn evaluates
to a constant.
In fact, the REG_EH_REGION note with lp > 0 can only come from the
original i3 and an assert is added to that effect. That means we only
need to retain the note on i3 or, if that cannot trap, drop it but we
should never move it to i2.
The following places constraints on the insns to combine with
non-call exceptions since we cannot handle the case where we
have more than one EH side-effect in the IL. The patch also
makes sure we can accumulate that on i3 and do not split
a possible exception raising part of it to i2. As a special
case we do not place any restriction on all externally
throwing insns when there is no REG_EH_REGION present.
2022-04-22 Richard Biener <rguenther@suse.de>
PR rtl-optimization/105231
* combine.cc (distribute_notes): Assert that a REG_EH_REGION
with landing pad > 0 is from i3. Put any REG_EH_REGION note
on i3 or drop it if the insn can not trap.
(try_combine): Ensure that we can merge REG_EH_REGION notes
with non-call exceptions. Ensure we are not splitting a
trapping part of an insn with non-call exceptions when there
is any REG_EH_REGION note to preserve.
* gcc.dg/torture/pr105231.c: New testcase.
Diffstat (limited to 'libphobos/libdruntime')
0 files changed, 0 insertions, 0 deletions