This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000] Fix PR target/42427
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Jan 2010 11:23:43 -0500
- Subject: Re: [PATCH, rs6000] Fix PR target/42427
- References: <1263498748.3301.3.camel@otta>
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