On Fri, Jun 28, 2013 at 11:09 AM, Michael Meissner <meiss...@linux.vnet.ibm.com> wrote: > This patch fixes PR 57744, where the compiler did not allocate even/odd > register combination for the lqarx and stqcx. instructions. I traced the > problem down to the fact that PTImode can only go in even GPRs (in part to > support the quad word instructions), while TImode can go in even/odd GPRs as > well as the VSX regsiters. In the example that showed the problem, the TImode > value is passed to the function in an odd/even register combination. By > setting MODES_TIEABLE_P, the compiler no longer assumes that TImode and > PTImode > automatically share registers. While I was modifying MODES_TIEABLE_P, I also > made similar changes for TDmode (which needs even FPR registers), and small > integers (which can't go in floating point/VSX registers). > > This patch bootstraps fine, and has no regressions. Is it ok to apply this > patch? > > [gcc] > 2013-06-28 Michael Meissner <meiss...@linux.vnet.ibm.com> > > PR target/57744 > * config/rs6000/rs6000.h (SMALL_INT_MODE): New macro, to recognize > small integer modes. > (MODES_TIEABLE_P): Do not allow PTImode or TDmode to tie with any > other modes. Don't allow small integer modes to tie with modes > that can go in floating point/VSX registers. Eliminate Altivec > vector mode tests, since these are a subset of ALTIVEC or VSX > vector modes. Simplify code, to return 0 if testing MODE2 for a > condition, if we've already tested MODE1 for the same condition. > > [gcc/testsuite] > 2013-06-28 Michael Meissner <meiss...@linux.vnet.ibm.com> > > PR target/57744 > * gcc.target/powerpc/pr57744.c: New test to make sure lqarx and > stqcx. get even registers.
All integer modes should be tieable. If normal, scalar modes are not tieable, we have more severe problems. The SMALL_INT_MODE macro should have had a comment in rs6000.h, not in the ChangeLog. But the SMALL_INT_MODE change to MODES_TIEABLE_P should not be included. Only the PTI change is okay. - David