]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Error on CPUs and ABIs that don't support the ROP protection insns [PR114759]
authorPeter Bergner <bergner@linux.ibm.com>
Mon, 15 Jul 2024 21:57:32 +0000 (16:57 -0500)
committerPeter Bergner <bergner@linux.ibm.com>
Wed, 24 Jul 2024 01:31:35 +0000 (20:31 -0500)
commit25cf4d2a2200903fe868f8cbd9d24f35768041c1
treea0ac74d4ea50cf31e6234fe6ee5ff218114dd767
parentaa293f40770bae5e94f33d4700f2f0ce9eff712b
rs6000: Error on CPUs and ABIs that don't support the ROP protection insns [PR114759]

We currently silently ignore the -mrop-protect option for old CPUs we don't
support with the ROP hash insns, but we throw an error for unsupported ABIs.
This patch treats unsupported CPUs and ABIs similarly by throwing an error
both both.  This matches clang behavior and allows us to simplify our tests
in the code that generates our prologue and epilogue code.

2024-06-26  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/114759
* config/rs6000/rs6000.cc (rs6000_option_override_internal): Disallow
CPUs and ABIs that do no support the ROP protection insns.
* config/rs6000/rs6000-logue.cc (rs6000_stack_info): Remove now
unneeded tests.
(rs6000_emit_prologue): Likewise.
Remove unneeded gcc_assert.
(rs6000_emit_epilogue): Likewise.
* config/rs6000/rs6000.md: Likewise.

gcc/testsuite/
PR target/114759
* gcc.target/powerpc/pr114759-3.c: New test.

(cherry picked from commit 6f2bab9b5d1ce1914c748b7dcd8638dafaa98df7)
gcc/config/rs6000/rs6000-logue.cc
gcc/config/rs6000/rs6000.cc
gcc/config/rs6000/rs6000.md
gcc/testsuite/gcc.target/powerpc/pr114759-3.c [new file with mode: 0644]