https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114779
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- That has nothing to do with inline functions and everything to do with pointer arguments to __builtin_constant_p. The builtin behaved that way since at least 1998. The current version still has /* If this expression has side effects, show we don't know it to be a constant. Likewise if it's a pointer or aggregate type since in those case we only want literals, since those are only optimized when generating RTL, not later. And finally, if we are compiling an initializer, not code, we need to return a definite result now; there's not going to be any more optimization done. */ if (TREE_SIDE_EFFECTS (arg) || AGGREGATE_TYPE_P (TREE_TYPE (arg)) || POINTER_TYPE_P (TREE_TYPE (arg)) || cfun == 0 || folding_initializer || force_folding_builtin_constant_p) return integer_zero_node; What triggers here is the POINTER_TYPE_P (TREE_TYPE (arg)) case. So, the builtin is immediately folded into 0 in that case.