]> 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@gcc.gnu.org>
Fri, 23 Aug 2024 16:45:40 +0000 (11:45 -0500)
commit6e68c3df1540c5bafbb47343698bf4e270333fdb
tree359ac4038dc641fcb04853f37d6ec3076fcec4cc
parentcb51e0b236c7d492af2033582230e78d8b55290f
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.
gcc/config/rs6000/rs6000-p8swap.cc
gcc/config/rs6000/rs6000.h
gcc/testsuite/gcc.target/powerpc/pr116415.c [new file with mode: 0644]