]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Fix PTImode handling in power8 swap optimization pass [PR116415]
authorPeter Bergner <bergner@linux.ibm.com>
Fri, 23 Aug 2024 16:45:40 +0000 (11:45 -0500)
committerPeter Bergner <bergner@linux.ibm.com>
Tue, 29 Oct 2024 03:38:48 +0000 (22:38 -0500)
commiteeb72f26ea7e70baadf2e3b9e89e8f7055fec0a9
tree35470f783cff6d797ce62712b01222aead8ee377
parent7f13d0705d3b0e8f2f53aa381b4e4b6323682b88
rs6000: Fix PTImode handling in power8 swap optimization pass [PR116415]

Our power8 swap optimization pass has some special handling for optimizing
swaps of TImode variables.  The test case reported in bugzilla uses a call
to  __atomic_compare_exchange, which introduces a variable of PTImode and
that does not get the same treatment as TImode leading to wrong code
generation.  The simple fix is to treat PTImode identically to TImode.

2024-08-23  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/116415
* config/rs6000/rs6000.h (TI_OR_PTI_MODE): New define.
* config/rs6000/rs6000-p8swap.cc (rs6000_analyze_swaps): Use it to
handle PTImode identically to TImode.

gcc/testsuite/
PR target/116415
* gcc.target/powerpc/pr116415.c: New test.

(cherry picked from commit 6e68c3df1540c5bafbb47343698bf4e270333fdb)
gcc/config/rs6000/rs6000-p8swap.cc
gcc/config/rs6000/rs6000.h
gcc/testsuite/gcc.target/powerpc/pr116415.c [new file with mode: 0644]