https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104976
Bug ID: 104976 Summary: [avx512fp16] lowpart_subreg return NULL_RTX cause ICE Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: crazylht at gmail dot com Target Milestone: --- void foo (int a, float b, double* c) { union { _Float16 f[2]; int i;} x; x.i = a; c[0] = x.f[0] * 0.2; c[1] = x.f[1] * 0.2; } 7165(define_expand "extendv2hfv2df2" 7166 [(set (match_operand:V2DF 0 "register_operand") 7167 (float_extend:V2DF 7168 (match_operand:V2HF 1 "nonimmediate_operand")))] 7169 "TARGET_AVX512FP16 && TARGET_AVX512VL" 7170{ 7171 if (!MEM_P (operands[1])) 7172 { 7173 operands[1] = lowpart_subreg (V8HFmode, operands[1], V2HFmode); 7174 emit_insn (gen_avx512fp16_float_extend_phv2df2 7175 (operands[0], operands[1])); 7176 DONE; 7177 } 7178}) here operands[1] is (subreg:V2HF (reg:SI) 0) which is valid, but not for (subreg:v8hf (reg:SI 0) and return NULL cause invalid rtl. 101(insn 8 7 9 (set (reg:V2DF 88 [ vect__1.3 ]) 102 (float_extend:V2DF (vec_select:V2HF (nil) 103 (parallel [ 104 (const_int 0 [0]) 105 (const_int 1 [0x1]) 106 ])))) "test3.c":8:13 -1 107 (nil))