[PATCH] auto-inc-dec: Don't add incs/decs to bare CLOBBERs [PR93124]
Jeff Law
law@redhat.com
Wed Jan 22 20:31:00 GMT 2020
On Wed, 2020-01-22 at 12:11 +0000, Richard Sandiford wrote:
> In this PR, auto-inc-dec was trying to turn:
>
> (set (reg X) (plus (reg X) (const_int N)))
> (clobber (mem (reg X)))
>
> into:
>
> (clobber (mem (pre_modify (reg X) ...)))
>
> But bare clobber insns are just there to describe dataflow. They're
> not supposed to generate any code.
>
> This is part 2 of the fix for PR93124. The reason we have the
> clobber above is that cprop replaced (reg sp) with (reg X) in:
>
> (clobber (mem (reg sp)))
>
> Part 1 stops that from happening, but I still think we should
> prevent auto-inc-dec from "optimising" bare USEs and CLOBBERs
> as a belt-and-braces fix.
>
> Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install?
>
> Richard
>
>
> 2020-01-22 Richard Sandiford <richard.sandiford@arm.com>
>
> gcc/
> PR rtl-optimization/93124
> * auto-inc-dec.c (merge_in_block): Don't add auto inc/decs to
> bare USE and CLOBBER insns.
>
> gcc/testsuite/
> * gcc.dg/torture/pr93124.c: New test.
OK.
Jeff
>
More information about the Gcc-patches
mailing list