From: Yoshinori Sato Date: Wed, 29 Jan 2025 15:07:15 +0000 (-0700) Subject: [PATCH] RX: Restrict displacement ranges in "Q" constraint X-Git-Tag: basepoints/gcc-16~2280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4318821562638a3d909942f561a42f7272ddfed4;p=thirdparty%2Fgcc.git [PATCH] RX: Restrict displacement ranges in "Q" constraint When using the "Q" constraint in the inline assembler, the displacement value could exceed the range specified by the instruction. To avoid this issue, a displacement range check is added to the "Q" constraint. gcc/ * config/rx/constraints.md (Q): Also check that the address passes rx_is_restricted_memory-address. --- diff --git a/gcc/config/rx/constraints.md b/gcc/config/rx/constraints.md index 4fc242667ab4..4b81ae6aa75b 100644 --- a/gcc/config/rx/constraints.md +++ b/gcc/config/rx/constraints.md @@ -80,7 +80,8 @@ (ior (match_code "reg" "0") (and (match_code "plus" "0") (and (match_code "reg,subreg" "00") - (match_code "const_int" "01") + (and (match_code "const_int" "01") + (match_test "rx_is_restricted_memory_address (XEXP (op, 0), mode)")) ) ) )