public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/41012] New: Missing inlining after indirect call promotion
@ 2009-08-09 6:23 davidxl at gcc dot gnu dot org
0 siblings, 0 replies; only message in thread
From: davidxl at gcc dot gnu dot org @ 2009-08-09 6:23 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-09 6:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-09 6:23 [Bug tree-optimization/41012] New: Missing inlining after indirect call promotion davidxl at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).