From: zhaozhou Date: Mon, 10 Nov 2025 07:20:26 +0000 (+0800) Subject: LoongArch: Fix predicate for symbolic_pcrel_offset_operand. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=522f07de307479556b37a841042c8421b0f36432;p=thirdparty%2Fgcc.git 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 --git a/gcc/config/loongarch/predicates.md b/gcc/config/loongarch/predicates.md index 8460618b501..957215ad89a 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")