The only way to enable or disable Power10 insns (ISA 3.1 insns) should be via the -mcpu= switch. This patch disables the -mpower10 options the same way the -mdirect-move switch is neutered already. That is not an ideal way, but it works, it is not the first, and doing it properly is more work, and will happen later.
Tested on powerpc64-linux {-m32,-m64}; committed. (Testcase is from Peter Bergner originally; all mangling is mine). 2020-07-24 Segher Boessenkool <seg...@kernel.crashing.org> * config/rs6000/rs6000.opt: Delete -mpower10. gcc/testsuite/ * gcc.target/powerpc/pr95907.c: New. --- gcc/config/rs6000/rs6000.opt | 3 +-- gcc/testsuite/gcc.target/powerpc/pr95907.c | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr95907.c diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt index 6b426f2..5910675 100644 --- a/gcc/config/rs6000/rs6000.opt +++ b/gcc/config/rs6000/rs6000.opt @@ -568,8 +568,7 @@ mspeculate-indirect-jumps Target Undocumented Var(rs6000_speculate_indirect_jumps) Init(1) Save mpower10 -Target Report Mask(POWER10) Var(rs6000_isa_flags) -Use instructions added in ISA 3.1. +Target Undocumented Mask(POWER10) Var(rs6000_isa_flags) WarnRemoved mprefixed Target Report Mask(PREFIXED) Var(rs6000_isa_flags) diff --git a/gcc/testsuite/gcc.target/powerpc/pr95907.c b/gcc/testsuite/gcc.target/powerpc/pr95907.c new file mode 100644 index 0000000..f2512b0 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr95907.c @@ -0,0 +1,7 @@ +/* PR target/95907 */ +/* { dg-do compile } */ +/* { dg-require-effective-target power10_ok } */ +/* { dg-options "-mpower10" } */ +/* { dg-warning "switch .-mpower10. is no longer supported" "" {target *-*-*} 0 } */ + +void f(void) { } -- 1.8.3.1