diff mbox series

[rs6000] Deprecate -mno-speculate-indirect-jumps

Message ID cd94fa2b-2c5b-598b-26f0-02e529985398@linux.vnet.ibm.com
State New
Headers show
Series [rs6000] Deprecate -mno-speculate-indirect-jumps | expand

Commit Message

Bill Schmidt Feb. 5, 2018, 6:28 p.m. UTC
Hi,

It's been determined that we won't recommend use of the recently added
undocumented option -mno-speculate-indirect-jumps.  This patch provides
a warning indicating that the option is deprecated.  We will leave the
code in place for potential emergency use (not expected), and plan to
remove it completely in GCC 9.

Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.
Is this okay for trunk?  At least one distribution partner has also
requested that we backport this to the GCC 7 branch for 7.4.  Is that
okay as well?

Thanks,
Bill


[gcc]

2018-02-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_option_override_internal):
	Display warning message for -mno-speculate-indirect-jumps.

[gcc/testsuite]

2018-02-05  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* gcc.target/powerpc/safe-indirect-jump-1.c: Detect deprecation
	warning for -mno-speculate-indirect-jumps.
	* gcc.target/powerpc/safe-indirect-jump-2.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-3.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-4.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-5.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-6.c: Likewise.
	* gcc.target/powerpc/safe-indirect-jump-7.c: Likewise.

Comments

Segher Boessenkool Feb. 6, 2018, 4:33 p.m. UTC | #1
Hi Bill,

On Mon, Feb 05, 2018 at 12:28:34PM -0600, Bill Schmidt wrote:
> It's been determined that we won't recommend use of the recently added
> undocumented option -mno-speculate-indirect-jumps.  This patch provides
> a warning indicating that the option is deprecated.  We will leave the
> code in place for potential emergency use (not expected), and plan to
> remove it completely in GCC 9.

> +  /* Deprecate use of -mno-speculate-indirect-jumps.  */
> +  if (!rs6000_speculate_indirect_jumps)
> +    warning (0, "%qs is deprecated and not recommended in any circumstances",
> +	     "-mno-speculate-indirect-jumps");

Wow that is a stern warning :-)

> --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c	(revision 257367)
> +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c	(working copy)
> @@ -1,5 +1,6 @@
>  /* { dg-do compile } */
>  /* { dg-additional-options "-mno-speculate-indirect-jumps" } */
> +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */

Just

/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" } */

will do I think?

(Some tests use . instead of ' but the latter works as well).

You could just add "-w" to the options instead.

Okay for trunk with or without that changed.  Okay for 7 too.  Thanks!


Segher
Bill Schmidt Feb. 6, 2018, 4:46 p.m. UTC | #2
On Feb 6, 2018, at 10:33 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> 
> Hi Bill,
> 
> On Mon, Feb 05, 2018 at 12:28:34PM -0600, Bill Schmidt wrote:
>> It's been determined that we won't recommend use of the recently added
>> undocumented option -mno-speculate-indirect-jumps.  This patch provides
>> a warning indicating that the option is deprecated.  We will leave the
>> code in place for potential emergency use (not expected), and plan to
>> remove it completely in GCC 9.
> 
>> +  /* Deprecate use of -mno-speculate-indirect-jumps.  */
>> +  if (!rs6000_speculate_indirect_jumps)
>> +    warning (0, "%qs is deprecated and not recommended in any circumstances",
>> +	     "-mno-speculate-indirect-jumps");
> 
> Wow that is a stern warning :-)
> 
>> --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c	(revision 257367)
>> +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c	(working copy)
>> @@ -1,5 +1,6 @@
>> /* { dg-do compile } */
>> /* { dg-additional-options "-mno-speculate-indirect-jumps" } */
>> +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
> 
> Just
> 
> /* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" } */
> 
> will do I think?

Unfortunately not -- I need to specify line 0, and without this we fail because the warning gets associated with line 3.

Thanks for the review!

Bill
> 
> (Some tests use . instead of ' but the latter works as well).
> 
> You could just add "-w" to the options instead.
> 
> Okay for trunk with or without that changed.  Okay for 7 too.  Thanks!
> 
> 
> Segher
>
diff mbox series

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 257367)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -5295,6 +5295,11 @@  rs6000_option_override_internal (bool global_init_
   if (TARGET_LINK_STACK == -1)
     SET_TARGET_LINK_STACK (rs6000_tune == PROCESSOR_PPC476 && flag_pic);
 
+  /* Deprecate use of -mno-speculate-indirect-jumps.  */
+  if (!rs6000_speculate_indirect_jumps)
+    warning (0, "%qs is deprecated and not recommended in any circumstances",
+	     "-mno-speculate-indirect-jumps");
+
   return ret;
 }
 
Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c	(revision 257367)
+++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-additional-options "-mno-speculate-indirect-jumps" } */
+/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
 
 /* Test for deliberate misprediction of indirect calls.  */
 
Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-2.c	(revision 257367)
+++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-2.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mno-speculate-indirect-jumps" } */
+/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
 
 /* Test for deliberate misprediction of computed goto.  */
 
Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-3.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-3.c	(revision 257367)
+++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-3.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-mno-speculate-indirect-jumps" } */
+/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
 
 /* Test for deliberate misprediction of jump tables.  */
 
Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-4.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-4.c	(revision 257367)
+++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-4.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do run } */
 /* { dg-additional-options "-mno-speculate-indirect-jumps" } */
+/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
 
 /* Test for deliberate misprediction of indirect calls for ELFv2.  */
 
Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-5.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-5.c	(revision 257367)
+++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-5.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do run } */
 /* { dg-additional-options "-mno-speculate-indirect-jumps -Wno-pedantic" } */
+/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
 
 /* Test for deliberate misprediction of computed goto.  */
 
Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-6.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-6.c	(revision 257367)
+++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-6.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do run } */
 /* { dg-additional-options "-mno-speculate-indirect-jumps" } */
+/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
 
 /* Test for deliberate misprediction of jump tables.  */
 
Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c	(revision 257367)
+++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-additional-options "-mno-speculate-indirect-jumps" } */
+/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */
 
 /* Test for deliberate misprediction of indirect calls.  */