diff options
author | Alex Coplan <alex.coplan@arm.com> | 2024-05-03 14:12:32 +0000 |
---|---|---|
committer | Alex Coplan <alex.coplan@arm.com> | 2024-05-08 11:52:57 +0100 |
commit | 73c8e24b692e691c665d0f1f5424432837bd8c06 (patch) | |
tree | 2e1c4acd54546bab99e4938addbb14082ea558b7 /gcc | |
parent | e755f478c24c3e99409936af545ac83d35d27ad9 (diff) | |
download | gcc-73c8e24b692e691c665d0f1f5424432837bd8c06.zip gcc-73c8e24b692e691c665d0f1f5424432837bd8c06.tar.gz gcc-73c8e24b692e691c665d0f1f5424432837bd8c06.tar.bz2 |
aarch64: Fix typo in aarch64-ldp-fusion.cc:combine_reg_notes [PR114936]
This fixes a typo in combine_reg_notes in the load/store pair fusion
pass. As it stands, the calls to filter_notes store any
REG_FRAME_RELATED_EXPR to fr_expr with the following association:
- i2 -> fr_expr[0]
- i1 -> fr_expr[1]
but then the checks inside the following if statement expect the
opposite (more natural) association, i.e.:
- i2 -> fr_expr[1]
- i1 -> fr_expr[0]
this patch fixes the oversight by swapping the fr_expr indices in the
calls to filter_notes.
In hindsight it would probably have been less confusing / error-prone to
have combine_reg_notes take an array of two insns, then we wouldn't have
to mix 1-based and 0-based indexing as well as remembering to call
filter_notes in reverse program order. This however is a minimal fix
for backporting purposes.
gcc/ChangeLog:
PR target/114936
* config/aarch64/aarch64-ldp-fusion.cc (combine_reg_notes):
Ensure insn iN has its REG_FRAME_RELATED_EXPR (if any) stored in
FR_EXPR[N-1], thus matching the correspondence expected by the
copy_rtx calls.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/aarch64/aarch64-ldp-fusion.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/aarch64/aarch64-ldp-fusion.cc b/gcc/config/aarch64/aarch64-ldp-fusion.cc index 437f0ae..1d9caea 100644 --- a/gcc/config/aarch64/aarch64-ldp-fusion.cc +++ b/gcc/config/aarch64/aarch64-ldp-fusion.cc @@ -1085,9 +1085,9 @@ combine_reg_notes (insn_info *i1, insn_info *i2, bool load_p) bool found_eh_region = false; rtx result = NULL_RTX; result = filter_notes (REG_NOTES (i2->rtl ()), result, - &found_eh_region, fr_expr); - result = filter_notes (REG_NOTES (i1->rtl ()), result, &found_eh_region, fr_expr + 1); + result = filter_notes (REG_NOTES (i1->rtl ()), result, + &found_eh_region, fr_expr); if (!load_p) { |