https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112296
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- Some history shows r0-31250-gb0b3afb2f34492 splitting this to the folding code from RTL expansion of __builtin_constant_p where it previously was. Even before r0-17364-gcff48d8f76463f we were simply doing @@ -8566,10 +8579,34 @@ expand_builtin (exp, target, subtarget, mode, ignore) tree arg = TREE_VALUE (arglist); STRIP_NOPS (arg); - return (TREE_CODE_CLASS (TREE_CODE (arg)) == 'c' - || (TREE_CODE (arg) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (arg, 0)) == STRING_CST) - ? const1_rtx : const0_rtx); and that dates back to r0-384-gbbf6f052d786c2, "Initial revision" of expr.c from Kenner :/