Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-02 Thread Jakub Jelinek
On Fri, Dec 02, 2016 at 03:51:52PM +0100, Bernd Schmidt wrote: > I like this a lot better. Of course now that it's spelled out it seems like > several of these (PC, CC0, RETURN, maybe SCRATCH) should never be passed to > shallow_copy_rtx and maybe a checking_assert to that effect might be in >

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-02 Thread Bernd Schmidt
On 12/02/2016 03:12 PM, Jakub Jelinek wrote: --- gcc/rtl.c.jj2016-10-31 13:28:12.0 +0100 +++ gcc/rtl.c 2016-12-02 11:01:12.557553040 +0100 @@ -318,10 +318,6 @@ copy_rtx (rtx orig) us to explicitly document why we are *not* copying a flag. */ copy = shallow_copy_rtx

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-02 Thread Jakub Jelinek
On Fri, Dec 02, 2016 at 12:34:13AM +0100, Jakub Jelinek wrote: > On Thu, Dec 01, 2016 at 11:48:03PM +0100, Bernd Schmidt wrote: > > On 12/01/2016 11:43 PM, Jakub Jelinek wrote: > > > > > >so we'd need to slow shallow_copy_rtx down by adding switch (code) > > >in there or something similar. > > >

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-01 Thread Jakub Jelinek
On Thu, Dec 01, 2016 at 11:48:03PM +0100, Bernd Schmidt wrote: > On 12/01/2016 11:43 PM, Jakub Jelinek wrote: > > > >so we'd need to slow shallow_copy_rtx down by adding switch (code) > >in there or something similar. > > Is there reason to assume it's time-critical? IMO eliminating the potential

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-01 Thread Bernd Schmidt
On 12/01/2016 11:43 PM, Jakub Jelinek wrote: so we'd need to slow shallow_copy_rtx down by adding switch (code) in there or something similar. Is there reason to assume it's time-critical? IMO eliminating the potential for error by not having callers need to do this outweighs that concern.

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-01 Thread Jakub Jelinek
On Thu, Dec 01, 2016 at 01:19:16PM +0100, Bernd Schmidt wrote: > On 11/30/2016 11:11 PM, Jakub Jelinek wrote: > >I run into the problem that while simplify_replace_rtx if it actually does > >copy_rtx (for y) or if it simplifies something through > >simplify_gen_{unary,binary,relational,ternary},

Re: [PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-12-01 Thread Bernd Schmidt
On 11/30/2016 11:11 PM, Jakub Jelinek wrote: I run into the problem that while simplify_replace_rtx if it actually does copy_rtx (for y) or if it simplifies something through simplify_gen_{unary,binary,relational,ternary}, the used bits on the newly created rtxes are cleared, when we fall

[PATCH] Unset used bit in simplify_replace_* on newly copied rtxs (PR target/78614)

2016-11-30 Thread Jakub Jelinek
Hi! Instead of a simple approach to fix PR78614 (a rs6000 backend bug) by adding: pat = copy_rtx (pat); before XVECEXP (pat, ...) = simplify_replace_rtx (XVECEXP (pat, ...), x, y); because simplify_replace_rtx doesn't unshare all rtxes, just those required not to modify the original expression