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

--- Comment #4 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
(In reply to Hongtao Liu from comment #2)
> So it looks like we need to handle ix86_avx_u128_mode_after 
> 
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -15177,7 +15177,14 @@ ix86_avx_u128_mode_after (int mode, rtx_insn *insn)
>        bool avx_upper_reg_found = false;
>        note_stores (insn, ix86_check_avx_upper_stores, &avx_upper_reg_found);
> 
> -      return avx_upper_reg_found ? AVX_U128_DIRTY : AVX_U128_CLEAN;
> +      if (avx_upper_reg_found)
> +       return AVX_U128_DIRTY;
> +
> +      const function_abi &abi = insn_callee_abi (insn);
> +      if (!hard_reg_set_subset_p (reg_class_contents[SSE_REGS],
> +                                 abi.mode_clobbers (V4DImode)))
> +       return AVX_U128_ANY;
> +      return  AVX_U128_CLEAN;
>      }
It's a long time since I looked at this code, but this looks correct
to me FWIW.

Reply via email to