]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: pa.c (pa_legitimate_address_p): For scaled indexing...
authorJohn David Anglin <danglin@gcc.gnu.org>
Sun, 17 Dec 2017 17:05:15 +0000 (17:05 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 17 Dec 2017 17:05:15 +0000 (17:05 +0000)
Backport from mainline
2017-12-03  John David Anglin  <danglin@gcc.gnu.org>

* config/pa/pa.c (pa_legitimate_address_p): For scaled indexing,
require base operand is a REG_POINTER prior to reload on targets
with non-equivalent space registers.

From-SVN: r255763

gcc/ChangeLog
gcc/config/pa/pa.c

index 3331fed614e54d444cbeafc08dcd80e82b92aade..30711960ee576bfa76d84e79454239aa77e50cc4 100644 (file)
@@ -1,3 +1,12 @@
+2017-12-17  John David Anglin  <danglin@gcc.gnu.org>
+
+       Backport from mainline
+       2017-12-03  John David Anglin  <danglin@gcc.gnu.org>
+
+       * config/pa/pa.c (pa_legitimate_address_p): For scaled indexing,
+       require base operand is a REG_POINTER prior to reload on targets
+       with non-equivalent space registers.
+
 2017-12-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR target/66488
index cc4dfcf1ba5d8e4f461aad5a11e8faa9d4ffc3a8..b4f7a7113ff43218e26b2cb64d2b014f394a9400 100644 (file)
@@ -10462,9 +10462,16 @@ pa_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 
       if (!TARGET_DISABLE_INDEXING
          && GET_CODE (index) == MULT
-         && MODE_OK_FOR_SCALED_INDEXING_P (mode)
+         /* Only accept base operands with the REG_POINTER flag prior to
+            reload on targets with non-equivalent space registers.  */
+         && (TARGET_NO_SPACE_REGS
+             || (base == XEXP (x, 1)
+                 && (reload_completed
+                     || (reload_in_progress && HARD_REGISTER_P (base))
+                     || REG_POINTER (base))))
          && REG_P (XEXP (index, 0))
          && GET_MODE (XEXP (index, 0)) == Pmode
+         && MODE_OK_FOR_SCALED_INDEXING_P (mode)
          && (strict ? STRICT_REG_OK_FOR_INDEX_P (XEXP (index, 0))
                     : REG_OK_FOR_INDEX_P (XEXP (index, 0)))
          && GET_CODE (XEXP (index, 1)) == CONST_INT