https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104976
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>: https://gcc.gnu.org/g:8fa7216ae0d8a15aaa1a54e1d8e308f791e65d97 commit r12-7775-g8fa7216ae0d8a15aaa1a54e1d8e308f791e65d97 Author: liuhongt <hongtao....@intel.com> Date: Mon Mar 21 09:10:50 2022 +0800 Fix ICE caused by NULL_RTX returned by lowpart_subreg. In validate_subreg, both (subreg:V2HF (reg:SI) 0) and (subreg:V8HF (reg:V2HF) 0) are valid, but not for (subreg:V8HF (reg:SI) 0) which causes ICE. Ideally it should be handled in validate_subreg to support subreg for all modes available in TARGET_CAN_CHANGE_MODE_CLASS, but that would be too risky in stage4, so the patch is a walkround in the backend to force_reg operands before lowpart_subreg for expanders or pre_reload splitters. gcc/ChangeLog: PR target/104976 * config/i386/sse.md (ssePSmodelower): New. (*avx_cmp<mode>3_ltint_not): Force_reg operand before lowpart_subreg to avoid NULL_RTX. (<avx512>_fmaddc_<mode>_mask1<round_expand_name>, <avx512>_fcmaddc_<mode>_mask1<round_expand_name>, fma_<mode>_fmaddc_bcst, fma_<mode>_fcmaddc_bcst, <avx512>_<complexopname>_<mode>_mask<round_name>, avx512fp16_fcmaddcsh_v8hf_mask1<round_expand_name>, avx512fp16_fcmaddcsh_v8hf_mask3<round_expand_name>, avx512fp16_fmaddcsh_v8hf_mask3<round_expand_name>, avx512fp16_fmaddcsh_v8hf_mask3<round_expand_name>, float<floatunssuffix><mode>v4hf2, float<floatunssuffix>v2div2hf2, fix<fixunssuffix>_truncv4hf<mode>2, fix<fixunssuffix>_truncv2hfv2di2, extendv4hf<mode>2, extendv2hfv2df2, trunc<mode>v4hf2,truncv2dfv2hf2, *avx512bw_permvar_truncv16siv16hi_1, *avx512bw_permvar_truncv16siv16hi_1_hf, *avx512f_permvar_truncv8siv8hi_1, *avx512f_permvar_truncv8siv8hi_1_hf, *avx512f_vpermvar_truncv8div8si_1, *avx512f_permvar_truncv32hiv32qi_1, *avx512f_permvar_truncv16hiv16qi_1, *avx512f_permvar_truncv4div4si_1, *avx512f_pshufb_truncv8hiv8qi_1, *avx512f_pshufb_truncv4siv4hi_1, *avx512f_pshufd_truncv2div2si_1, sdot_prod<mode>, avx2_pblend<ssemodesuffix>_1, ashrv2di3,ashrv2di3,usdot_prod<mode>): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/pr104976.c: New test. * gcc.target/i386/avx512fp16-vfcmaddcph-1a.c: Scan either vblendps or masked vmovaps. * gcc.target/i386/avx512fp16-vfmaddcph-1a.c: Ditto * gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c: Ditto. * gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c: Ditto.