]> gcc.gnu.org Git - gcc.git/commit
Fix power10 fusion and -fstack-protector, PR target/105325
authorMichael Meissner <meissner@linux.ibm.com>
Fri, 9 Jun 2023 04:16:48 +0000 (00:16 -0400)
committerMichael Meissner <meissner@linux.ibm.com>
Fri, 9 Jun 2023 04:16:48 +0000 (00:16 -0400)
commit5a6a3d7f0a6ccc1ddf64f76ff68329d2be949da1
treef765fb6b475b9592f56ea94a8f4966b172597536
parent58c44f326ff9a73311bf10622154296ef9e5b8f5
Fix power10 fusion and -fstack-protector, PR target/105325

This patch fixes an issue where if you use the -fstack-protector and
-mcpu=power10 options and you have a large stack frame, the GCC compiler will
generate a LWA instruction with a large offset.

There are several problems with the current GCC:

    1) The constraints in fusion.md (generated by genfusion.pl) use "m" for LWA
and LD, when they should use "YZ".

    2) The normal calls to address_is_non_pfx_d_or_x doesn't work with lwa,
because you need to pass in DImode instead of SImode.  It is simplified
if you use the lwa_operand predicate instead of ds_form_mem_operand.

The fix is to modify genfusion.pl that it sets the "YZ" constraint instead of
"m" for the ld and lwa instructions.

I modified the genfusion.pl code use to use lwa_operand for the lwa instruction
to prevent prefixed addresses at combine time.

2023-06-08   Michael Meissner  <meissner@linux.ibm.com>

gcc/

* config/rs6000/genfusion.pl (gen_ld_cmpi_p10_one): Fix problems that
allowed prefixed lwa to be generated.
* config/rs6000/fusion.md: Regenerate.

gcc/testsuite/

* g++.target/powerpc/pr105325.C: New test.
gcc/config/rs6000/fusion.md
gcc/config/rs6000/genfusion.pl
gcc/testsuite/g++.target/powerpc/pr105325.C [new file with mode: 0644]
This page took 0.058425 seconds and 6 git commands to generate.