This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52708] suboptimal code with __builtin_constant_p
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 Mar 2012 08:17:39 +0000
- Subject: [Bug c/52708] suboptimal code with __builtin_constant_p
- Auto-submitted: auto-generated
- References: <bug-52708-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52708
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2012-03-26
Ever Confirmed|0 |1
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-26 08:17:39 UTC ---
Hm. We delay evaluating __builtin_constant_p to make it possible for inlining
to lead to simplifications that result in a constant. We could of course
evaluate early if there are any side-effects in its argument, but that would
change outcome in existing code bases.
What do you think specifies the behavior you are expecting? Nothing
explicitely
says that the argument is not evaluated or that its side-effects are discarded.