https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78633

--- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #1)
> Here is a trial patch
> 
> diff --git a/config/sh/sh.md b/config/sh/sh.md
> index c6956a0..c83bf08 100644
> --- a/config/sh/sh.md
> +++ b/config/sh/sh.md
> @@ -858,7 +858,8 @@
>        operands of the tstsi_t insn, which is generally the case.  */
>        if (dump_file)
>       fprintf (dump_file, "cmpeqsi_t: replacing with tstsi_t\n");
> -      emit_insn (gen_tstsi_t (XEXP (op.set_src, 0), XEXP (op.set_src, 1)));
> +      emit_insn (gen_tstsi_t (copy_rtx (XEXP (op.set_src, 0)),
> +                           XEXP (op.set_src, 1)));
>        DONE;
>      }
>  
> Oleg, could you take a look at the issue?  Although the patch fixes
> the ICE, I'm not sure if it's OK and enough.

Hm ... if this is a latent bug, I would like to understand why it's wrong to
reference a reg rtx in the insn input operands.  I've been doing that in
several places in similar ways...

Reply via email to