]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Fix predicate for symbolic_pcrel_offset_operand.
authorzhaozhou <zhaozhou@loongson.cn>
Mon, 10 Nov 2025 07:20:26 +0000 (15:20 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Fri, 14 Nov 2025 01:15:24 +0000 (09:15 +0800)
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.

gcc/config/loongarch/predicates.md

index 8460618b501b9c9f3afe5d76e8597529d4c45911..957215ad89a5bc96362656834082ad389dcbc213 100644 (file)
 
 (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")