public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]
@ 2023-08-21 10:32 jeevitha
  2023-08-22  1:51 ` Kewen.Lin
  0 siblings, 1 reply; 14+ messages in thread
From: jeevitha @ 2023-08-21 10:32 UTC (permalink / raw)
  To: segher, gcc-patches, Kewen.Lin; +Cc: Peter Bergner

Hi All,

The following patch has been bootstrapped and regtested on powerpc64-linux.

It is currently possible to incorrectly enable PCREL for targets that do not
officially support it. Disable PCREL for targets that do not support it.

2023-08-21  Jeevitha Palanisamy  <jeevitha@linux.ibm.com>

gcc/
	PR target/111045
	* config/rs6000/rs6000.cc (rs6000_option_override_internal): Disable PCREL
	for unsupported targets.

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index efe9adc..4838f8c 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -4232,6 +4232,9 @@ rs6000_option_override_internal (bool global_init_p)
       rs6000_isa_flags &= ~OPTION_MASK_FLOAT128_HW;
     }
 
+  if (!rs6000_pcrel_p())
+    rs6000_isa_flags &= ~OPTION_MASK_PCREL;
+
   /* Enable -mprefixed by default on power10 systems.  */
   if (TARGET_POWER10 && (rs6000_isa_flags_explicit & OPTION_MASK_PREFIXED) == 0)
     rs6000_isa_flags |= OPTION_MASK_PREFIXED;


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

end of thread, other threads:[~2023-11-27 23:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-21 10:32 [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045] jeevitha
2023-08-22  1:51 ` Kewen.Lin
2023-08-24  2:07   ` Peter Bergner
2023-08-24  5:56     ` Kewen.Lin
2023-08-25  3:20       ` Peter Bergner
2023-08-25 11:20         ` Kewen.Lin
2023-08-25 22:04           ` Peter Bergner
2023-08-28  2:06             ` Kewen.Lin
2023-11-10 23:51               ` Peter Bergner
2023-11-13 18:24                 ` jeevitha
2023-11-14  2:33                 ` Kewen.Lin
2023-11-14 21:40                   ` Peter Bergner
2023-11-11  0:03           ` Peter Bergner
2023-11-27 23:11             ` Michael Meissner

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