https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116415
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Peter Bergner <berg...@gcc.gnu.org>: https://gcc.gnu.org/g:6e68c3df1540c5bafbb47343698bf4e270333fdb commit r15-3136-g6e68c3df1540c5bafbb47343698bf4e270333fdb Author: Peter Bergner <berg...@linux.ibm.com> Date: Fri Aug 23 11:45:40 2024 -0500 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 <berg...@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.