public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] s390: Fix TARGET_SECONDARY_RELOAD for non-SYMBOL_REFs
@ 2024-02-29 12:13 Stefan Schulze Frielinghaus
  2024-02-29 12:26 ` Andreas Schwab
  2024-03-11  9:44 ` Andreas Krebbel
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Schulze Frielinghaus @ 2024-02-29 12:13 UTC (permalink / raw)
  To: krebbel, gcc-patches; +Cc: Stefan Schulze Frielinghaus

RTX X must not necessarily be a SYMBOL_REF and may e.g. be an
UNSPEC_GOTENT for which SYMBOL_FLAG_NOTALIGN2_P fails.

gcc/ChangeLog:

	* config/s390/s390.cc (s390_secondary_reload): Guard
	SYMBOL_FLAG_NOTALIGN2_P.
---
 gcc/config/s390/s390.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 943fc9bfd72..12430d77786 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -4778,7 +4778,7 @@ s390_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i,
       if (in_p
 	  && s390_loadrelative_operand_p (x, &symref, &offset)
 	  && mode == Pmode
-	  && !SYMBOL_FLAG_NOTALIGN2_P (symref)
+	  && (!SYMBOL_REF_P (symref) || !SYMBOL_FLAG_NOTALIGN2_P (symref))
 	  && (offset & 1) == 1)
 	sri->icode = ((mode == DImode) ? CODE_FOR_reloaddi_larl_odd_addend_z10
 		      : CODE_FOR_reloadsi_larl_odd_addend_z10);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-11  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 12:13 [PATCH] s390: Fix TARGET_SECONDARY_RELOAD for non-SYMBOL_REFs Stefan Schulze Frielinghaus
2024-02-29 12:26 ` Andreas Schwab
2024-02-29 12:46   ` Stefan Schulze Frielinghaus
2024-03-11  9:44 ` Andreas Krebbel

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).