On Wed, Mar 07, 2018 at 06:50:41PM -0600, Peter Bergner wrote: > PR83969 shows another bug in mem_operand_gpr() (which implements the "Y" > constraint) accepting reg+reg addresses. This was fixed by adding a call > to rs6000_offsettable_memref_p() to verify the address is a valid offsettable > address. Fixing that exposed a problem in the *movdi_internal64 pattern > which was using the "Y" constraint for the integer load/store alternatives, > which allow either reg+offset or reg+reg addresses. This worked before > only because of the buggy mem_operand_gpr. The fix for that was to use > the "YZ" constraint which allows both reg+offset and reg+reg addresses. > > This passed bootstrap and regtesting on powerpc64-linux, running the > testsuite in both 32-bit and 64-bit modes with no regressions. > Ok for trunk?
Sorry this took a while to review. It is okay for trunk. Does this need backports? Thanks! Segher > gcc/ > PR target/83969 > * config/rs6000/rs6000.c (rs6000_offsettable_memref_p): New prototype. > Add strict argument and use it. > (rs6000_split_multireg_move): Update for new strict argument. > (mem_operand_gpr): Disallow all non-offsettable addresses. > * config/rs6000/rs6000.md (*movdi_internal64): Use YZ constraint. > > gcc/testsuite/ > PR target/83969 > * gcc.target/powerpc/pr83969.c: New test.