https://gcc.gnu.org/g:522f07de307479556b37a841042c8421b0f36432
commit r16-5265-g522f07de307479556b37a841042c8421b0f36432 Author: zhaozhou <[email protected]> Date: Mon Nov 10 15:20:26 2025 +0800 LoongArch: Fix predicate for symbolic_pcrel_offset_operand. The predicate checks if the operand is PLUS(symbol_ref, const_int), but the match (match_operand 0/1) is not equal XEXP(op, 0/1). It should be adjusted to use match_test and pass XEXP(op, 0/1) into the constraint function. gcc/ChangeLog: * config/loongarch/predicates.md: Update ops. Diff: --- gcc/config/loongarch/predicates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/loongarch/predicates.md b/gcc/config/loongarch/predicates.md index 8460618b501b..957215ad89a5 100644 --- a/gcc/config/loongarch/predicates.md +++ b/gcc/config/loongarch/predicates.md @@ -575,8 +575,8 @@ (define_predicate "symbolic_pcrel_offset_operand" (and (match_code "plus") - (match_operand 0 "symbolic_pcrel_operand") - (match_operand 1 "const_int_operand"))) + (match_test "symbolic_pcrel_operand (XEXP (op, 0), mode)") + (match_test "const_int_operand (XEXP (op, 1), mode)"))) (define_predicate "mem_simple_ldst_operand" (match_code "mem")
