From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB8153858408; Tue, 3 Jan 2023 10:27:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB8153858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672741631; bh=1DYEhysAzZpp5kwJcf3Br9UUJAzkQoRLPKQln7loj6U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VHB8oIvqwzkFyyku82wj+dIgIIGx91VPUGJmb37W7PRxNKCCOjsePD5RObNRkq7Lo /lkZ6Px+fzz1HBdNZPW02Uc0qnGAzgU05r4QmFrUbYfaN4Sfpnz++/ty53J/T9JRpb 4gGhbuWrymkNshISCBRXt8HZGD/maNdiw/CyvN9U= From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/106816] noreturn/pure attributes are not set correctly on multiversioned functions Date: Tue, 03 Jan 2023 10:27:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin 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=3D106816 --- Comment #9 from Martin Jambor --- (In reply to Martin Li=C5=A1ka from comment #6) >=20 > @Martin: Do we have a declaration cloning code for functions somewhere? See e.g. cgraph_node::create_virtual_clone in cgraphclones.cc. Unless you want to mess with the parameters, new_decl =3D copy_node (old_decl); should be enough (and it should copy over the DECL_PURE and TREE_READLONY bit soo, I believe). I am not sure at what point the duplication happens, in order to duplicate also all the various IPA summaries, cgraph machinery has to be involved and call all the summary hooks. So cgraph_node::create_clone should probably be used (or a part of it, or perhaps even one of its users?).=