On the effect of #pragma STDC CX_LIMITED_RANGE ON

Hi.

I am finding that using said pragma does not have the intended effect of disabling the C99 Annex G compliance that generates calls into the rather slow __mulsc3 and __muldc3 soft float library functions. This behavior was observed in Clang 11 and 10 (I did not test older revisions).

Allow me to link to godbolt to compare the generated code for this short code snippet:

#pragma STDC CX_LIMITED_RANGE ON
#include
std::complex f(std::complex x) {
return x*x;
}

https://godbolt.org/z/cEs3E1

I find that the #pragma does not remove the call into __mulsc3 in said example, whereas setting the flag -fno-honor-nans has the intended effect.

However I am worried that -fno-honor-nans would also affect code other than complex number arithmetic.

Would you maybe consider supporting the -fcx-limited-range compiler switch that is available in the GCC compiler?

Christian