https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126221
--- Comment #8 from Hu Lin <lin1.hu at intel dot com> --- Created attachment 65023 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65023&action=edit Untested fix. According to my test, r17-1764-gc2cdc43bc60b32 triggers the issue. emit_cmp_and_jump_insns used GET_MODE (expand_normal (masked_op)) to select the mask mode. For vector boolean constants that expand to CONST_INT, this produces VOIDmode and triggers the assertion mode != VOID_mode in maybe_legitimize_operand. So I use mask_mode = TYPE_MODE (TREE_TYPE (masked_op)). The ICE has been fixed. Testing of more test cases is ongoing.
