[Bug target/126434] [17 Regression] ICE: invalid rtl sharing found in the insn {zero_extendsidi2}

"konstantinos.eleftheriou at vrull dot eu via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126434

--- Comment #4 from Konstantinos Eleftheriou <konstantinos.eleftheriou at vrull dot eu> ---
(In reply to Jakub Jelinek from comment #3)
> --- gcc/avoid-store-forwarding.cc.jj	2026-06-05 20:39:09.411516351 +0200
> +++ gcc/avoid-store-forwarding.cc	2026-07-28 11:50:15.835271670 +0200
> @@ -444,7 +444,7 @@ process_store_forwarding (vec<store_fwd_
>        else
>  	move_src = dest;
>  
> -      rtx move = gen_rtx_SET (SET_DEST (load), move_src);
> +      rtx move = gen_rtx_SET (copy_rtx (SET_DEST (load)), move_src);
>  
>        start_sequence ();
>        rtx_insn *insn = emit_insn (move);
> 
> fixes this exact case, but wonder how many other RTX sharing bugs are in the
> pass.
> E.g. dest = SET_DEST (load); and tons of uses of dest in various new insns,
> etc.

We're testing a patch with this exact fix right now. We will investigate
for other possible sharing issues too.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.