From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19862 invoked by alias); 9 Aug 2009 06:23:13 -0000 Received: (qmail 19836 invoked by uid 48); 9 Aug 2009 06:23:00 -0000 Date: Sun, 09 Aug 2009 06:23:00 -0000 Subject: [Bug tree-optimization/41012] New: Missing inlining after indirect call promotion X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "davidxl at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00829.txt.bz2 Compiling the following test case with FDO, virtual call base->Foo(id) is promoted/specialized in valueProf transformation. However the resulting direct call is not inlined due to type mismatch. The problem is that the 2nd ARG_TYPE associated with the indirect call is a record type, but the actual argument type is a reference/pointer type -- this is required by C++ ABI for passing record typed object with nontrival constructor. During gimple-lowering, the callsite is marked as cannot_be_inlined and this attribute is copied to the promoted direct callsite. // ======== class DocId { public: DocId() { } DocId(const DocId &other) { } }; class Base { public: virtual void Foo(DocId id) { } }; class Super: public Base { public: void Foo(DocId id) { } void Bar(Base *base, DocId id); }; void Super::Bar(Base *base, DocId id) { Super::Foo(id); // direct call is inlined base->Foo(id); // indirect call is marked do not inline } int main(void) { Base bah; Super baz; DocId gid; baz.Bar(&bah, gid); return 0; } -- Summary: Missing inlining after indirect call promotion Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization AssignedTo: davidxl at gcc dot gnu dot org ReportedBy: davidxl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41012