Annex F conforming Intel targeted clang / gcc does not raise "invalid" floating-point exception for (signed char)128.0f, bug?

Viewed 85

Annex F requires raising of "invalid" floating-point exception (C11, Annex F, F.4 Floating to integer conversion):

... if the floating value is infinite or NaN or if the integral part of the floating value exceeds the range of the integer type, then the ‘‘invalid’’ floating-point exception is raised and the resulting value is unspecified.

For (signed char)128.0f the latest Intel targeted clang / gcc / msvc generate cvttss2si or cvttss2sil, which does not signal the invalid operation exception (for this case) as required by Annex F.

Since both gcc and clang define __STDC_IEC_559__ (at least on Linux), does it mean that code generated by both gcc and clang violates Annex F?

UPD. The msvc team is not interested to fix it. Bug report was closed as "not a problem".

0 Answers
Related