public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/35545]  New: virtual call specialization not happening with FDO
@ 2008-03-12  5:56 xinliangli at gmail dot com
  2008-03-12  6:08 ` [Bug middle-end/35545] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 22+ messages in thread
From: xinliangli at gmail dot com @ 2008-03-12  5:56 UTC (permalink / raw)
  To: gcc-bugs

In the following example, virtual calls via ap should be speciallized -- there
is one dominatating call target, but compiling the program at -O3 with
-fprofile-use, it does not happen.

g++ -O1 -fprofile-generate devirt.cc
./a.out
g++ -fprofile-use -O3 -fdump-tree-optimized devirt.cc


// devirt.cc

class A {
public:
  virtual int foo() {
     return 1;
  }

int i;
};

class B : public A
{
public:
  virtual int foo() {
     return 2;
  }

 int b;
} ;


int main()
{
 int i;

  A* ap = 0;

  for (i = 0; i < 10000; i++)
  {

     if (i%7==0)
     {
        ap = new A();
     }
     else
        ap = new B();

    ap->foo();

    delete ap;

  }

  return 0;

}


-- 
           Summary: virtual call specialization not happening with FDO
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xinliangli at gmail dot com


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


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

end of thread, other threads:[~2014-10-01 11:30 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-35545-4@http.gcc.gnu.org/bugzilla/>
2013-12-17 16:34 ` [Bug middle-end/35545] virtual call specialization not happening with FDO hubicka at gcc dot gnu.org
2013-12-17 17:29 ` hubicka at gcc dot gnu.org
2013-12-17 18:06 ` rguenther at suse dot de
2013-12-17 18:09 ` hubicka at gcc dot gnu.org
2013-12-17 20:33 ` law at redhat dot com
2013-12-17 20:39 ` hubicka at ucw dot cz
2013-12-17 20:53 ` law at redhat dot com
2013-12-17 21:15 ` hubicka at ucw dot cz
2014-09-25 21:29 ` hubicka at gcc dot gnu.org
2014-09-26  7:44 ` [Bug middle-end/35545] tracer pass is run too late rguenth at gcc dot gnu.org
2014-09-26 15:52 ` law at redhat dot com
2014-09-27  0:04 ` hubicka at gcc dot gnu.org
2014-09-27  0:14 ` hubicka at gcc dot gnu.org
2014-09-27  0:23 ` xinliangli at gmail dot com
2014-09-27  1:04 ` hubicka at ucw dot cz
2014-09-28 18:22 ` xinliangli at gmail dot com
2014-09-29  8:17 ` rguenther at suse dot de
2014-09-29 10:22 ` rguenther at suse dot de
2014-09-29 16:48 ` hubicka at ucw dot cz
2014-09-29 19:30 ` xinliangli at gmail dot com
2014-10-01 11:30 ` mliska at suse dot cz
2008-03-12  5:56 [Bug middle-end/35545] New: virtual call specialization not happening with FDO xinliangli at gmail dot com
2008-03-12  6:08 ` [Bug middle-end/35545] " pinskia 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).