https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115115

--- Comment #10 from Jan Wassenberg <jan.wassenberg at gmail dot com> ---
We have a workaround. I changed the ConvertTo (round to nearest int) code to 

const auto overflow = RebindMask(di, Ge(v, Set(df, 2147483648.0f)));
return IfThenElse(overflow, Set(di, LimitsMax<int32_t>()), ConvertInRangeTo(di,
v)));

However, this requires an additional workaround, inserting in the middle

#if HWY_COMPILER_GCC_ACTUAL
v = IfThenZeroElse(RebindMask(df, overflow), v);
#endif

It seems that passing an out of bounds value to _mm_cvtps_epi32 (bug is about
cvttps, but cvtps also had the problem), even if its return value will be
unused due to the IfThenElse (blending), still causes breakage. This is
unfortunate.

Wrapping the workaround in __builtin_constant_p(v) causes it to fail, so it
seems the error is not in constant folding.

Reply via email to