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.

Signed-off-by: Yoshinori Sato <ys...@users.sourceforge.jp>
---
 gcc/config/rx/constraints.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rx/constraints.md b/gcc/config/rx/constraints.md
index c5188a3bc78..8f42ade56a8 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)"))
                 )
            )
        )
-- 
2.39.5

Reply via email to