* [committed] hppa: Fix REG+D address support before reload
@ 2024-03-14 18:38 John David Anglin
0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2024-03-14 18:38 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 1797 bytes --]
Tested on hppa-unknown-linux-gnu. Committed to trunk.
Dave
---
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.
diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc
index 694123e37c9..129289f8e62 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-14 18:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 18:38 [committed] hppa: Fix REG+D address support before reload John David Anglin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).