This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Questions about the ATTRS field of builtins.def
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc at gcc dot gnu dot org
- Cc: jsm28 at cam dot ac dot uk, roger at eyesopen dot com
- Date: Thu, 31 Jul 2003 19:11:20 -0400 (EDT)
- Subject: Questions about the ATTRS field of builtins.def
I'm trying to make sense of the ATTRS field in builtins.def. For the
math functions, I see several variants:
1. ATTR_CONST_NOTHROW_LIST
2. flag_unsafe_math_optimizations ? ATTR_CONST_NOTHROW_LIST
: ATTR_PURE_NOTHROW_LIST
3. flag_errno_math ? ATTR_NOTHROW_LIST
: (flag_unsafe_math_optimizations
? ATTR_CONST_NOTHROW_LIST
: ATTR_PURE_NOTHROW_LIST)
I understand 1 and I understand 3's errno check. What I don't
understand is number 2, or why 3 contains 2 in one of its clauses.
When is 2 necessary and why?
I also see many discrepancies. E.g. "cos" uses 2, but "round" and
others use case 1. What makes "cos" need case 2? What's odd is that
the man page on x86-linux says "round" may set errno to EDOM so
shouldn't it (and perhaps others) use number 3?
Finally, is there a complete online reference somewhere that lists all
of the C90 vs C99 math functions and explains which names were
reserved in C90 but unimplemented until C99? (This will help me
decide which DEF_* macro to use on each function.)
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu