This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54021] [c++0x] __builtin_constant_p should be constexpr
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Jul 2012 06:53:11 +0000
- Subject: [Bug c++/54021] [c++0x] __builtin_constant_p should be constexpr
- Auto-submitted: auto-generated
- References: <bug-54021-4@http.gcc.gnu.org/bugzilla/>
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.