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

--- Comment #12 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #7)
> So perhaps:
> --- gcc/lra-constraints.cc.jj 2023-03-17 16:09:09.162136438 +0100
> +++ gcc/lra-constraints.cc    2023-03-17 21:37:04.799285670 +0100
> @@ -5020,7 +5020,9 @@ combine_reload_insn (rtx_insn *from, rtx
>    /* Check conditions for second memory reload and original insn:  */
>    if ((targetm.secondary_memory_needed
>         == hook_bool_mode_reg_class_t_reg_class_t_false)
> -      || NEXT_INSN (from) != to || CALL_P (to)
> +      || NEXT_INSN (from) != to
> +      || !NONDEBUG_INSN_P (to)
> +      || CALL_P (to)
>        || id->used_insn_alternative == LRA_UNKNOWN_ALT
>        || (set = single_set (from)) == NULL_RTX)
>      return false;
> ?

This doesn't work as is, since the ICE is occurring on code before we get here
in the function.  Specifically here:

   lra_insn_recog_data_t id = lra_get_insn_recog_data (to);

I'll try moving the test up earlier and testing with that.

Reply via email to