diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-10-02 14:21:24 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-10-03 01:31:11 -0700 |
commit | edec4bfc99744b48da3ffde1e4f39c9aceecfd42 (patch) | |
tree | faebf55a43c545dabda491f1a6960aaff3204e77 /gcc/config/aarch64 | |
parent | ccb6e08a4d5a067513b3a10bbf0d76e28e1d4a8e (diff) | |
download | gcc-edec4bfc99744b48da3ffde1e4f39c9aceecfd42.zip gcc-edec4bfc99744b48da3ffde1e4f39c9aceecfd42.tar.gz gcc-edec4bfc99744b48da3ffde1e4f39c9aceecfd42.tar.bz2 |
aarch64: Fix early ra for -fno-delete-dead-exceptions [PR116927]
Early-RA was considering throwing instructions as being dead and removing
them even if -fno-delete-dead-exceptions was in use. This fixes that oversight.
Built and tested for aarch64-linux-gnu.
PR target/116927
gcc/ChangeLog:
* config/aarch64/aarch64-early-ra.cc (early_ra::is_dead_insn): Insns
that throw are not dead with -fno-delete-dead-exceptions.
gcc/testsuite/ChangeLog:
* g++.dg/torture/pr116927-1.C: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/config/aarch64')
-rw-r--r-- | gcc/config/aarch64/aarch64-early-ra.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64-early-ra.cc b/gcc/config/aarch64/aarch64-early-ra.cc index 5f269d0..6e544dd 100644 --- a/gcc/config/aarch64/aarch64-early-ra.cc +++ b/gcc/config/aarch64/aarch64-early-ra.cc @@ -3389,6 +3389,12 @@ early_ra::is_dead_insn (rtx_insn *insn) if (side_effects_p (set)) return false; + /* If we can't delete dead exceptions and the insn throws, + then the instruction is not dead. */ + if (!cfun->can_delete_dead_exceptions + && !insn_nothrow_p (insn)) + return false; + return true; } |