aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2024-03-14 18:32:56 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2024-03-14 18:32:56 +0000
commit53fd0f5b1fd737a208c12909fa1188281cb370a3 (patch)
tree302ec5470b41a2065c9fffba5b08e052ef3890a2
parent6cf4286ff9456685a29812a3560d00b956d62c39 (diff)
downloadgcc-53fd0f5b1fd737a208c12909fa1188281cb370a3.zip
gcc-53fd0f5b1fd737a208c12909fa1188281cb370a3.tar.gz
gcc-53fd0f5b1fd737a208c12909fa1188281cb370a3.tar.bz2
hppa: Fix REG+D address support before reload
When generating PA 1.x code or code for GNU ld, floating-point accesses only support 5-bit displacements but integer accesses support 14-bit displacements. I mistakenly assumed reload could fix an invalid 14-bit displacement in a floating-point access but this is not the case. 2024-03-14 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: PR target/114288 * config/pa/pa.cc (pa_legitimate_address_p): Don't allow 14-bit displacements before reload for modes that may use a floating-point load or store.
-rw-r--r--gcc/config/pa/pa.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 694123e..129289f 100644
--- a/gcc/config/pa/pa.cc
+++ b/gcc/config/pa/pa.cc
@@ -10968,20 +10968,15 @@ pa_legitimate_address_p (machine_mode mode, rtx x, bool strict, code_helper)
/* Long 14-bit displacements always okay for these cases. */
if (INT14_OK_STRICT
+ || reload_completed
|| mode == QImode
|| mode == HImode)
return true;
- /* A secondary reload may be needed to adjust the displacement
- of floating-point accesses when STRICT is nonzero. */
- if (strict)
- return false;
-
- /* We get significantly better code if we allow long displacements
- before reload for all accesses. Instructions must satisfy their
- constraints after reload, so we must have an integer access.
- Return true for both cases. */
- return true;
+ /* We have to limit displacements to those supported by
+ both floating-point and integer accesses as reload can't
+ fix invalid displacements. See PR114288. */
+ return false;
}
if (!TARGET_DISABLE_INDEXING