https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123320
--- Comment #3 from chenglulu <chenglulu at loongson dot cn> ---
Should we add such a check to all similar operations in the define_expand
template?(In reply to Xi Ruoyao from comment #2)
> Tentative fix:
>
> diff --git a/gcc/config/loongarch/loongarch.md
> b/gcc/config/loongarch/loongarch.md
> index 39e315c818b..09054bc97db 100644
> --- a/gcc/config/loongarch/loongarch.md
> +++ b/gcc/config/loongarch/loongarch.md
> @@ -648,7 +648,7 @@ (define_expand "<optab><mode>3"
> (match_operand:SI 2 "arith_operand" "rI")))]
> ""
> {
> - if (TARGET_64BIT && <MODE>mode == SImode)
> + if (TARGET_64BIT && <MODE>mode == SImode && can_create_pseudo_p ())
> {
Should we add such a check to all similar operations in the define_expand
template?
> rtx t = gen_reg_rtx (DImode);
> emit_insn (gen_<optab>si3_extend (t, operands[1], operands[2]));