]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Make 32 bit stack_protect support prefixed insn [PR111367]
authorKewen Lin <linkw@linux.ibm.com>
Thu, 12 Oct 2023 05:05:03 +0000 (00:05 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 12 Oct 2023 05:05:03 +0000 (00:05 -0500)
commit530babc2058be5f2b06b1541384e7b730c368b93
treef0eb86dfa61beb3d28a9e9f12b1393633c3dc1fa
parent610b845a426e26fa86724e5c9d6f74c7a4baf741
rs6000: Make 32 bit stack_protect support prefixed insn [PR111367]

As PR111367 shows, with prefixed insn supported, some of
checkings consider it's able to leverage prefixed insn
for stack protect related load/store, but since we don't
actually change the emitted assembly for 32 bit, it can
cause the assembler error as exposed.

Mike's commit r10-4547-gce6a6c007e5a98 has already handled
the 64 bit case (DImode), this patch is to treat the 32
bit case (SImode) by making use of mode iterator P and
ptrload attribute iterator, also fixes the constraints
to match the emitted operand formats.

PR target/111367

gcc/ChangeLog:

* config/rs6000/rs6000.md (stack_protect_setsi): Support prefixed
instruction emission and incorporate to stack_protect_set<mode>.
(stack_protect_setdi): Rename to ...
(stack_protect_set<mode>): ... this, adjust constraint.
(stack_protect_testsi): Support prefixed instruction emission and
incorporate to stack_protect_test<mode>.
(stack_protect_testdi): Rename to ...
(stack_protect_test<mode>): ... this, adjust constraint.

gcc/testsuite/ChangeLog:

* g++.target/powerpc/pr111367.C: New test.
gcc/config/rs6000/rs6000.md
gcc/testsuite/g++.target/powerpc/pr111367.C [new file with mode: 0644]