This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH} rs6000: Enable PC-relative by default and test


Hi,

This is a short patch that enables PC-relative support by default, and provides a
test case to ensure that the correct .localentry name,1 directive is produced iff
PC-relative support is enabled.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu.  Okay for trunk?

Thanks,
Bill


[gcc]

2019-05-23  Bill Schmidt  <wschmidt@linux.ibm.com>
	    Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000-cpus.def (OTHER_FUTURES_MASK): New #define.

[gcc/testsuite]

2019-05-23  Bill Schmidt  <wschmidt@linux.ibm.com>

	* gcc.target/powerpc/pcrel-detect-1.c: New file.


diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index 64292c923e6..5337382bdcf 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -77,6 +77,9 @@
 				 | OPTION_MASK_FUTURE			\
 				 | OPTION_MASK_PCREL)
 
+/* Flags that need to be turned off if -mno-future.  */
+#define OTHER_FUTURE_MASKS	(OPTION_MASK_PCREL)
+
 /* Flags that need to be turned off if -mno-power9-vector.  */
 #define OTHER_P9_VECTOR_MASKS	(OPTION_MASK_FLOAT128_HW		\
 				 | OPTION_MASK_P9_MINMAX)
diff --git a/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c b/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c
new file mode 100644
index 00000000000..8e0e9053dc7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pcrel-detect-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target powerpc_elfv2 } */
+/* { dg-options "-O3 -mdejagnu-cpu=future" } */
+
+
+int localentry1 () { return 5; }
+
+#pragma GCC target ("cpu=power9")
+int localentry2 () { return 5; }
+
+/* { dg-final { scan-assembler {\.localentry\tlocalentry1,1\M} } } */
+/* { dg-final { scan-assembler-not {\.localentry\tlocalentry2,1\M} } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]