From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E98893858C36; Tue, 31 Oct 2023 14:13:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E98893858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698761633; bh=3VziHENIdpNqdDtXwSDtxaqdF3ucmG90D/HRkUDG1iI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cDAZf3cmKc9ja7NpcC75QBbhZuRh7DfixKxDnK7j99ja9viXMko1ZsYb2v/mWh/2B +ESGTAU6l6IuOtw3sD1BML+IUATYANretb0OygQpYJDVK+iQDIcDL3huqqiHhltrwS 6Mg7EMasf9vEmZHF5MH5kJR9jfDQ8RmZU60vdyeE= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112296] __builtin_constant_p doesn't propagate through member functions Date: Tue, 31 Oct 2023 14:13:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: documentation, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112296 --- Comment #10 from Richard Biener --- 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, ignor= e) tree arg =3D TREE_VALUE (arglist); STRIP_NOPS (arg); - return (TREE_CODE_CLASS (TREE_CODE (arg)) =3D=3D 'c' - || (TREE_CODE (arg) =3D=3D ADDR_EXPR - && TREE_CODE (TREE_OPERAND (arg, 0)) =3D=3D STRING_CS= T) - ? const1_rtx : const0_rtx); and that dates back to r0-384-gbbf6f052d786c2, "Initial revision" of expr.c from Kenner :/=