aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2024-01-16 15:37:49 -0800
committerAndrew Pinski <quic_apinski@quicinc.com>2024-01-17 14:03:19 -0800
commit7a8124e341aebcc544b4720e920b625f4ffe4e8a (patch)
tree424cbcf02e2ac1300a4232c656ce8e4626dc0b31 /gcc/config
parent3340878009acfc69f5315386437841a277174c83 (diff)
downloadgcc-7a8124e341aebcc544b4720e920b625f4ffe4e8a.zip
gcc-7a8124e341aebcc544b4720e920b625f4ffe4e8a.tar.gz
gcc-7a8124e341aebcc544b4720e920b625f4ffe4e8a.tar.bz2
aarch64: Fix aarch64_ldp_reg_operand predicate not to allow all subreg [PR113221]
So the problem here is that aarch64_ldp_reg_operand will all subreg even subreg of lo_sum. When LRA tries to fix that up, all things break. So the fix is to change the check to only allow reg and subreg of regs. Note the tendancy here is to use register_operand but that checks the mode of the register but we need to allow a mismatch modes for this predicate for now. Built and tested for aarch64-linux-gnu with no regressions (Also tested with the LD/ST pair pass back on). PR target/113221 gcc/ChangeLog: * config/aarch64/predicates.md (aarch64_ldp_reg_operand): For subreg, only allow REG operands instead of allowing all. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr113221-1.c: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/aarch64/predicates.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md
index 8a204e4..b895f5d 100644
--- a/gcc/config/aarch64/predicates.md
+++ b/gcc/config/aarch64/predicates.md
@@ -313,7 +313,11 @@
(define_special_predicate "aarch64_ldp_reg_operand"
(and
- (match_code "reg,subreg")
+ (ior
+ (match_code "reg")
+ (and
+ (match_code "subreg")
+ (match_test "REG_P (SUBREG_REG (op))")))
(match_test "aarch64_ldpstp_operand_mode_p (GET_MODE (op))")
(ior
(match_test "mode == VOIDmode")