On Sun, Jun 9, 2013 at 10:57 AM, Jakub Jelinek <ja...@redhat.com> wrote:

> These two peephole2s misbehave if it sees e.g.
> regN = mem
> regN = regN + regN
> mem = regN
> CC = regN != 0
> because transforming it into
> mem = mem + regN ; CC = mem != 0
> is wrong, I forgot to verify the second operand of the
> plusminuslogic_operator doesn't overlap the first operand.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk/4.8 and perhaps also 4.7 (where it is just latent)?
>
> 2013-06-09  Jakub Jelinek  <ja...@redhat.com>
>
>         PR target/57568
>         * config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure
>         that operands[2] doesn't overlap with operands[0].
>
>         * gcc.c-torture/execute/pr57568.c: New test.

The patch is OK everywhere.

Thanks,
Uros.

Reply via email to