This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix rtl sharing bug in the combiner (PR rtl-optimization/79909)
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 9 Mar 2017 17:48:48 -0600
- Subject: Re: [PATCH] Fix rtl sharing bug in the combiner (PR rtl-optimization/79909)
- Authentication-results: sourceware.org; auth=none
- References: <20170309211217.GL22703@tucnak>
Hi Jakub,
On Thu, Mar 09, 2017 at 10:12:17PM +0100, Jakub Jelinek wrote:
> The following testcase fails on ppc* due to invalid RTL sharing.
> The problem is that replace_rtx never copy_rtx or copy_rtx_if_shared
> anything, so if i{2,1,0}dest is present in CALL_INSN_FUNCTION_USAGE more
> than once, and corresponding i{2,1,0}src is non-shareable RTL, then we ICE.
> On the other side, copying whole CALL_INSN_FUNCTION_USAGE just in case, even
> if we don't make any changes in there seems like a waste to me, furthermore,
> I think the checking should make sure that CALL_INSN_FUNCTION_USAGE is never
> shared between multiple instructions, so it shouldn't be a problem to modify
> it in place. And lastly, if say i2dest appears in (plus i2dest const_int)
> and i2src is (plus reg const_int), we don't simplify that into a single
> plus.
>
> The following patch should fix that, by not copying the EXPR_LIST nodes at
> all, and just using simplify_replace_rtx which will not modify if no change
> is needed, and will copy_rtx the src whenever a replacement is made.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
Okay, thanks!
Segher