Restrict the two sources of vect_recog_cond_expr_convert_pattern to be of the same type when convert is extension.
It's not equal to transform
(cond (cmp @1 @2) (convert@3 @4) (convert@5 @6))
to
(convert (cmp @1 @2) (convert)@4 @6)
when(convert@3 @4) is extension because it's zero_extend vs sign_extend.
gcc/ChangeLog:
PR tree-optimization/104551
PR tree-optimization/103771
* match.pd (cond_expr_convert_p): Add types_match check when
convert is extension.
* tree-vect-patterns.cc
(gimple_cond_expr_convert_p): Adjust comments.
(vect_recog_cond_expr_convert_pattern): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr104551.c: New test.