From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1312F3858C78; Tue, 15 Feb 2022 08:13:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1312F3858C78 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104539] Failed to inline a very simple template function when it's explicit instantiated. Date: Tue, 15 Feb 2022 08:13:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords cf_reconfirmed_on component everconfirmed cc bug_status cf_known_to_fail 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2022 08:13:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104539 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Last reconfirmed| |2022-02-15 Component|tree-optimization |c++ Ever confirmed|0 |1 CC| |hubicka at gcc dot gnu.org, | |jason at gcc dot gnu.org Status|UNCONFIRMED |NEW Known to fail| |12.0 --- Comment #2 from Richard Biener --- t.ii:9:20: missed: not inlinable: int g()/1 -> int f() [with int =3D 0]/0, function body can be overwritten at link time so the issue seems to be that explicitely instantiating changes _Z1fILi0EEiv/1 (int f() [with int =3D 0]) @0x7ffff6697220 Type: function definition analyzed Visibility: semantic_interposition public weak comdat comdat_group:_Z1fILi0EEiv one_only Aux: @0x42d7d00 References: Referring: Function flags: body Called by: _Z1gv/0 Calls: to _Z1fILi0EEiv/0 (int f() [with int =3D 0]) @0x7ffff6697000 Type: function definition analyzed Visibility: forced_by_abi semantic_interposition public weak comdat_group:_Z1fILi0EEiv one_only Aux: @0x7ffff6697220 References: Referring: Function flags: body Called by: _Z1gv/1 (can throw external) Calls: the explicit instantiation lacks COMDAT (but has comdat_group) and it has forced_by_abi. I'm not sure the C++ standard calls out any semantic difference for explicit vs. implicit instantiations but maybe the Itanium ABI does. Jason? Honza?=