[Bug c/52708] suboptimal code with __builtin_constant_p

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 26 08:23:00 GMT 2012


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.



More information about the Gcc-bugs mailing list