With the extra GENERIC folding we now do to
(unsigned int) __v._M_value & 1 != (unsigned int) __v._M_value
we end up with a sign-extending conversion to unsigned int
rather than the sign-conversion to unsigned char we expect.
Relaxing that fixes the regression.
2022-05-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/105629
* tree-ssa-phiopt.cc (spaceship_replacement): Allow
a sign-extending conversion.
if (!TYPE_UNSIGNED (ty2) || !INTEGRAL_TYPE_P (ty2))
return false;
- if (TYPE_PRECISION (ty1) != TYPE_PRECISION (ty2))
+ if (TYPE_PRECISION (ty1) > TYPE_PRECISION (ty2))
return false;
if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig_use_lhs))
return false;