https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118696
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I believe the bug is in *vec_cmpgt<mode><mode>_nocc_emu (and also *vec_cmpgtu<mode><mode>_nocc_emu). We are doing 128-bit y > x. That is (hi(y) gt hi(x)) or ((hi(y) eq hi(x)) and (lo(y) gtu lo(x))). But the splitter does (define_insn_and_split "*vec_cmpgt<mode><mode>_nocc_emu" [(set (match_operand:VI_HW_T 0 "register_operand" "=v") (gt:VI_HW_T (match_operand:VI_HW_T 1 "register_operand" "v") (match_operand:VI_HW_T 2 "register_operand" "v")))] "TARGET_VX && !TARGET_VXE3" "#" "&& can_create_pseudo_p ()" [(set (match_dup 3) (gt:V2DI (match_dup 1) (match_dup 2))) (set (match_dup 4) (eq:V2DI (match_dup 1) (match_dup 2))) (set (match_dup 5) (gtu:V2DI (match_dup 1) (match_dup 2))) (set (match_dup 5) (vec_select:V2DI (match_dup 5) (parallel [(const_int 1) (const_int 0)]))) (set (match_dup 4) (and:V2DI (match_dup 4) (match_dup 5))) (set (match_dup 4) (ior:V2DI (match_dup 3) (match_dup 4))) (set (match_dup 4) (vec_duplicate:V2DI (vec_select:DI (match_dup 4) (parallel [(const_int 1)])))) (set (match_dup 0) (subreg:<MODE> (match_dup 4) 0))] { operands[1] = simplify_gen_subreg (V2DImode, operands[1], <MODE>mode, 0); operands[2] = simplify_gen_subreg (V2DImode, operands[2], <MODE>mode, 0); operands[3] = gen_reg_rtx (V2DImode); operands[4] = gen_reg_rtx (V2DImode); operands[5] = gen_reg_rtx (V2DImode); }) i.e. it computes everything right except for the splat. The result is in the first element of V2DImode rather than second, that is where we have gt of the hi parts ored with (eq of the hi parts anded with gtu of the low parts).