http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54021
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-07-19 06:53:11 UTC --- This is rejected only at -O0 and quite matches how __builtin_constant_p normally behaves at -O0 - you really need a constant right in the __builtin_constant_p argument, everything else results in 0. With -O1 and above you get BUILTIN_CONSTANT_P not folded right away to 0 if not constant and whether it in the end folds to 0 or 1 depends on optimization, whether a constant is propagated to it or not.