[Bug middle-end/26724] __builtin_constant_p fails to recognise function with constant return

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Feb 2 01:02:18 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26724

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|missed-optimization         |documentation
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
From
https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fconstant_005fp:
The expression is not evaluated, side-effects are discarded. 

So a function call is a side effect and will be thrown away.


More information about the Gcc-bugs mailing list