[PATCH] D39611: [CodeGen] make cbrt and fma constant (never set errno); document complex calls as always constant
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 6 13:12:45 PST 2017
efriedma added a comment.
Currently, the clang driver supports three platforms which have errno-setting libc implementations: GNU/Linux (with glibc), Solaris, and Windows (with Visual Studio CRT). (BSD-based systems, including OS X, never set errno in libm, so they aren't relevant here.) As long as our markings are consistent with those targets, we should be fine.
Both MSVC and GNU libraries never set errno for cbrt() and fma(); we want to keep those assumptions in clang.
We can ignore Visual Studio for the discussion of complex.h, I guess, because MSVC doesn't support _Complex. (It has a header called complex.h, but the types aren't right, so clang won't recognize any of the functions. For reference, though, its cabs() and catanh() set errno).
I have no idea how Solaris and other Unix targets handle these functions; it's probably a bad idea to add special cases for them without testing.
More information about the cfe-commits