https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98537
--- Comment #8 from Hongtao.liu <crazylht at gmail dot com> --- Created attachment 50045 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50045&action=edit Fix ICE: Don't generate integer mask comparision for 128/256-bits vector when op_true/op_false are NULL or constm1_rtx/const0_rtx [PR98537] I'm retesting this patch which is supposed to fix all performance and correctness regressions caused by r10-5250. in ix86_expand_sse_cmp/ix86_expand_int_sse_cmp - if (ix86_valid_mask_cmp_mode (cmp_ops_mode)) + if (GET_MODE_SIZE (mode) == 64 + || (ix86_valid_mask_cmp_mode (cmp_ops_mode) + /* When op_true and op_false is NULL, vector dest is required. */ + && op_true && op_false + /* Gimple sometimes transforms vec_cmpmn to vcondmn with + op_true/op_false as constm1_rtx/const0_rtx. + Don't generate integer mask comparison then. */ + && !((vector_all_ones_operand (op_true, GET_MODE (op_true)) + && CONST0_RTX (GET_MODE (op_false)) == op_false) + || (vector_all_ones_operand (op_false, GET_MODE (op_false)) + && CONST0_RTX (GET_MODE (op_true)) == op_true))))