public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45791] New: Missed devirtualization
@ 2010-09-25 17:28 hubicka at gcc dot gnu.org
  2010-09-25 19:50 ` [Bug tree-optimization/45791] " hubicka at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: hubicka at gcc dot gnu.org @ 2010-09-25 17:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45791

           Summary: Missed devirtualization
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hubicka@gcc.gnu.org


Compiling
// PR rtl-optimization/36185
// { dg-do run }
// { dg-options "-O2 -fgcse-sm" }

struct Base {
        virtual ~Base() {}
        virtual void f() = 0;
};
struct Derived : Base {
        Derived();
        virtual void f() {}
};
struct Foo {
        Foo(Base&);
};
Derived::Derived() {
        Foo foo(*this);
}
Foo::Foo(Base& base) {
        base.f();
}
int main() {
        Derived d;
}

makes einline to produce:
  MEM[(struct Base *)&d]._vptr.Base = &_ZTV4Base[2];
  d.D.2114._vptr.Base = &_ZTV7Derived[2];
  D.2243_5 = &d.D.2114;
  D.2241_6 = MEM[(struct Base *)&d]._vptr.Base;
  D.2242_7 = MEM[(int (*__vtbl_ptr_type) (void) *)D.2241_6 + 16B];
  OBJ_TYPE_REF(D.2242_7;D.2243_5->2) (D.2243_5);
this should get devirtualized but doesn't

-- 
Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-01-07 17:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-25 17:28 [Bug tree-optimization/45791] New: Missed devirtualization hubicka at gcc dot gnu.org
2010-09-25 19:50 ` [Bug tree-optimization/45791] " hubicka at gcc dot gnu.org
2010-09-26  3:33 ` hubicka at gcc dot gnu.org
2010-09-26  3:39 ` hubicka at gcc dot gnu.org
2010-09-26  6:02 ` hubicka at gcc dot gnu.org
2010-10-11 17:15 ` jamborm at gcc dot gnu.org
2010-10-11 18:40 ` jamborm at gcc dot gnu.org
2010-12-14 17:46 ` jamborm at gcc dot gnu.org
2010-12-14 23:15 ` hubicka at gcc dot gnu.org
2010-12-14 23:17 ` hubicka at gcc dot gnu.org
2010-12-14 23:35 ` jamborm at gcc dot gnu.org
2010-12-15  0:10 ` hubicka at gcc dot gnu.org
2010-12-15  0:13 ` hubicka at gcc dot gnu.org
2010-12-15 16:07 ` jamborm at gcc dot gnu.org
2014-02-24  9:44 ` matthijs at stdin dot nl
2014-09-25 20:29 ` hubicka at gcc dot gnu.org
2021-01-07 17:38 ` jamborm at gcc dot gnu.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).