https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116415
--- Comment #6 from Peter Bergner <bergner at gcc dot gnu.org> --- (In reply to Peter Bergner from comment #5) > I'm testing a fix. > > Our P8 swap optimization has some special handling for TImode usage. The > __atomic_compare_exchange call introduces a PTImode use and that should have > the same special handling that TImode has, but doesn't. The simple fix > fixes the attached test case for me and PASSes all of the swap-p8-*.c > testsuite test cases. My full bootstrap and regtesting is running. FYI, here is the fix that survived bootstrap and regtesting with no regressions which I'll submit. diff --git a/gcc/config/rs6000/rs6000-p8swap.cc b/gcc/config/rs6000/rs6000-p8swap.cc index 639f477d782..15e44bb63a6 100644 --- a/gcc/config/rs6000/rs6000-p8swap.cc +++ b/gcc/config/rs6000/rs6000-p8swap.cc @@ -2469,10 +2469,11 @@ rs6000_analyze_swaps (function *fun) mode = V4SImode; } - if (ALTIVEC_OR_VSX_VECTOR_MODE (mode) || mode == TImode) + if (ALTIVEC_OR_VSX_VECTOR_MODE (mode) || mode == TImode + || mode == PTImode) { insn_entry[uid].is_relevant = 1; - if (mode == TImode || mode == V1TImode + if (mode == TImode || mode == PTImode || mode == V1TImode || FLOAT128_VECTOR_P (mode)) insn_entry[uid].is_128_int = 1; if (DF_REF_INSN_INFO (mention)) @@ -2497,10 +2498,11 @@ rs6000_analyze_swaps (function *fun) && ALTIVEC_OR_VSX_VECTOR_MODE (GET_MODE (SET_DEST (insn)))) mode = GET_MODE (SET_DEST (insn)); - if (ALTIVEC_OR_VSX_VECTOR_MODE (mode) || mode == TImode) + if (ALTIVEC_OR_VSX_VECTOR_MODE (mode) || mode == TImode + || mode == PTImode) { insn_entry[uid].is_relevant = 1; - if (mode == TImode || mode == V1TImode + if (mode == TImode || mode == PTImode || mode == V1TImode || FLOAT128_VECTOR_P (mode)) insn_entry[uid].is_128_int = 1; if (DF_REF_INSN_INFO (mention))