This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rs6000] Fix PR target/42427


On Thu, Jan 14, 2010 at 2:52 PM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> This patch fixes a latent bug exposed by Bernd's regrename patch (r154688).
> The old code assumed that if the low order destination hardreg was used
> in the address calculation, then the instruction could not possibly be
> an auto-increment form instruction since the address is known to be
> dead. ?However, that is only true of reg+offset addresses. ?If we have an
> indexed form (eg, reg+reg) update instruction, then the address doesn't
> die if the low ordered destination register is used as the offset register.
> It cannot be used as the base reg, since that form is invalid so we'll
> never see that case here.

Peter,

Something seems strange about this patch -- either overly complicated
or wrong.  The block is protected by

      if (rs6000_offsettable_memref_p (operands[1])
          || (GET_CODE (operands[1]) == MEM
              && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM
                  || GET_CODE (XEXP (operands[1], 0)) == PRE_INC
                  || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC
                  || GET_CODE (XEXP (operands[1], 0)) == PRE_MODIFY)))

while your patch tests

+             && GET_CODE (XEXP (operands[1], 0)) != PRE_INC
+             && GET_CODE (XEXP (operands[1], 0)) != PRE_DEC
+             && GET_CODE (XEXP (operands[1], 0)) != PRE_MODIFY)

I think you only need to handle the PRE_MODIFY (indexed addressing)
situation and I think the tests needs to be refactored.

Thanks, David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]