===================================================================
@@ -75,10 +75,10 @@
| OPTION_MASK_P8_VECTOR \
| OPTION_MASK_P9_VECTOR)
-/* Support for a future processor's features. */
+/* Support for a future processor's features. Do not enable -mpcrel until is
+ fully functional. */
#define ISA_FUTURE_MASKS_SERVER (ISA_3_0_MASKS_SERVER \
| OPTION_MASK_FUTURE \
- | OPTION_MASK_PCREL \
| OPTION_MASK_PREFIXED_ADDR)
/* Flags that need to be turned off if -mno-future. */
===================================================================
@@ -4245,22 +4245,24 @@ rs6000_option_override_internal (bool gl
rs6000_isa_flags &= ~OPTION_MASK_FLOAT128_HW;
}
- /* -mpcrel requires prefixed load/store addressing. */
- if (TARGET_PCREL && !TARGET_PREFIXED_ADDR)
+ /* -mprefixed-addr (and hence -mpcrel) requires -mcpu=future. */
+ if ((TARGET_PREFIXED_ADDR || TARGET_PCREL) && !TARGET_FUTURE)
{
if ((rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0)
- error ("%qs requires %qs", "-mpcrel", "-mprefixed-addr");
+ error ("%qs requires %qs", "-mpcrel", "-mcpu=future");
+ else if ((rs6000_isa_flags_explicit & OPTION_MASK_PREFIXED_ADDR) != 0)
+ error ("%qs requires %qs", "-mprefixed-addr", "-mcpu=future");
- rs6000_isa_flags &= ~OPTION_MASK_PCREL;
+ rs6000_isa_flags &= ~(OPTION_MASK_PCREL | OPTION_MASK_PREFIXED_ADDR);
}
- /* -mprefixed-addr (and hence -mpcrel) requires -mcpu=future. */
- if (TARGET_PREFIXED_ADDR && !TARGET_FUTURE)
+ /* -mpcrel requires prefixed load/store addressing. */
+ if (TARGET_PCREL && !TARGET_PREFIXED_ADDR)
{
if ((rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0)
- error ("%qs requires %qs", "-mprefixed-addr", "-mcpu=future");
+ error ("%qs requires %qs", "-mpcrel", "-mprefixed-addr");
- rs6000_isa_flags &= ~(OPTION_MASK_PCREL | OPTION_MASK_PREFIXED_ADDR);
+ rs6000_isa_flags &= ~OPTION_MASK_PCREL;
}
/* Print the options after updating the defaults. */
@@ -37155,6 +37157,7 @@ rs6000_disable_incompatible_switches (vo
const HOST_WIDE_INT dep_flags; /* flags that depend on this option. */
const char *const name; /* name of the switch. */
} flags[] = {
+ { OPTION_MASK_FUTURE, OTHER_FUTURE_MASKS, "future" },
{ OPTION_MASK_P9_VECTOR, OTHER_P9_VECTOR_MASKS, "power9-vector" },
{ OPTION_MASK_P8_VECTOR, OTHER_P8_VECTOR_MASKS, "power8-vector" },
{ OPTION_MASK_VSX, OTHER_VSX_VECTOR_MASKS, "vsx" },
===================================================================
@@ -1,10 +1,11 @@
/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
+/* { dg-options "-mdejagnu-cpu=future -O2 -mpcrel" } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_future_ok } */
-/* Ensure we generate ".localentry fn,1" for both leaf and non-leaf
- functions. */
+/* Ensure we generate ".localentry fn,1" for both leaf and non-leaf functions.
+ At present, -mcpu=future does not enable pc-relative mode, so make sure we
+ enable it to be able to check for .localentry. */
extern int y (int);
===================================================================
@@ -3,10 +3,12 @@
/* { dg-require-effective-target powerpc_future_ok } */
/* { dg-options "-O2 -mdejagnu-cpu=future" } */
-
+/* At present, -mcpu=future does not enable pc-relative mode. Enable it here
+ explicitly until it is turned on by default. */
+#pragma GCC target ("cpu=future,pcrel")
int localentry1 () { return 5; }
-#pragma GCC target ("cpu=power9")
+#pragma GCC target ("cpu=power9,no-pcrel")
int localentry2 () { return 5; }
/* { dg-final { scan-assembler {\.localentry\tlocalentry1,1\M} } } */
===================================================================
@@ -1,10 +1,11 @@
/* { dg-do compile } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
+/* { dg-options "-mdejagnu-cpu=future -O2 -mpcrel" } */
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_future_ok } */
-/* Test that calls generated from PC-relative code are
- annotated with @notoc. */
+/* Test that calls generated from PC-relative code are annotated with @notoc.
+ At present, -mcpu=future does not enable pc-relative mode. Enable it here
+ explicitly until it is turned on by default. */
extern int yy0 (int);
extern void yy1 (int);
===================================================================
@@ -3,9 +3,12 @@
/* { dg-require-effective-target powerpc_elfv2 } */
/* { dg-require-effective-target powerpc_future_ok } */
-/* Test that potential sibcalls are not generated when the caller preserves
- the TOC and the callee doesn't, or vice versa. */
+/* Test that potential sibcalls are not generated when the caller preserves the
+ TOC and the callee doesn't, or vice versa. At present, -mcpu=future does
+ not enable pc-relative mode. Enable it here explicitly until it is turned
+ on by default. */
+#pragma GCC target ("cpu=future,pcrel")
int x (void) __attribute__((noinline));
int y (void) __attribute__((noinline));
int xx (void) __attribute__((noinline));
@@ -25,7 +28,7 @@ int sib_call (void)
return x ();
}
-#pragma GCC target ("cpu=power9")
+#pragma GCC target ("cpu=power9,no-pcrel")
int normal_call (void)
{
return y ();
@@ -36,7 +39,7 @@ int xx (void)
return 1;
}
-#pragma GCC target ("cpu=future")
+#pragma GCC target ("cpu=future,pcrel")
int notoc_call (void)
{
return xx ();