[Bug c/66963] __builtin_constant_p and __builtin_choose_expr do not agree on what is a constexpr with -O2

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Tue Jul 28 22:57:00 GMT 2015


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

--- Comment #5 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
This is by design.  __builtin_choose_expr requires an integer constant 
expression which must be evaluated before the type of the result can be 
known; __builtin_constant_p is for optimization and evaluates, much later, 
whether something is folded to a constant (including constant arguments to 
inline functions).



More information about the Gcc-bugs mailing list