Re: [PATCH] __builtin_early_constant_p (PR c++/78420)

2018-03-08 Thread Jason Merrill
On Wed, Mar 7, 2018 at 5:04 PM, Jakub Jelinek wrote: > - /* Don't fold __builtin_constant_p within a constexpr function. */ > - bool bi_const_p = (DECL_FUNCTION_CODE (fun) == BUILT_IN_CONSTANT_P); > + /* Don't fold __builtin_{,early_}constant_p within a constexpr function. > */ > + bool bi_

[PATCH] __builtin_early_constant_p (PR c++/78420)

2018-03-07 Thread Jakub Jelinek
Hi! This is the implementation of __builtin_early_constant_p builtin which is at all optimization levels quite similar to __builtin_constant_p at -O0, except that the FE folding might be slightly different between -O0 and -O1+. In any case, the builtin is folded to 0 already during the FEs if the