https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107863
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |10.5 Summary|ICE with unrecognizable |[10/11/12/13 Regression] |insn when using |ICE with unrecognizable |-funsigned-char with some |insn when using |AVX builtins |-funsigned-char with some | |SSE/AVX builtins Known to work| |4.4.7 Keywords| |ice-on-valid-code Known to fail| |4.5.3 Last reconfirmed| |2022-11-24 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced to just: #include <immintrin.h> __m128i f(__m128i a) { return _mm_insert_epi8(a, -1, 2); } This only requires -msse4.1 -funsigned-char to reproduce the ICE. ;; _4 = __builtin_ia32_vec_set_v16qi (_1, 255, 2); (insn 7 6 8 (set (reg:QI 86) (const_int 255 [0xff])) "/app/example.cpp":4:11 -1 (nil)) Without -funsigned-char: ;; _4 = __builtin_ia32_vec_set_v16qi (_1, -1, 2); (insn 7 6 8 (set (reg:QI 86) (const_int -1 [0xffffffffffffffff])) "/app/example.cpp":4:11 -1 (nil)) I suspect the issue is the definition of __builtin_ia32_vec_set_v16qi uses char type rather than signed/unsigned char here ...