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 <wschm...@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 <wschm...@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. 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. */