https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121479
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is not a bug, that is exactly how __builtin_constant_p is designed and
documented:
"The function returns the integer 1 if the argument is known
to be a compile-time constant and 0 if it is not known to be a
compile-time constant. A return of 0 does not indicate that the
value is _not_ a constant, but merely that GCC cannot prove it is a
constant with the specified value of the '-O' option."