Re: Inline virtual call puzzling behaviour

2013-07-09 Thread Michael Matz
Hi, On Sun, 7 Jul 2013, Thierry Lavoie wrote: > int main(int argc, char** argv) > { > A* ptr = 0; > if(argc == 1) > ptr = new B(); > else > ptr = new A(); > > ptr->blah(); > > B().blah(); > C().blah(); > } > > The

Inline virtual call puzzling behaviour

2013-07-07 Thread Thierry Lavoie
Hi, I've been playing around gcc -flto flag and inlining functionnalities for a while in search of both optimized performance and full understanding of g++ behavious. Right now, I'm puzzled by the assembly output produced for that piece of code: #include using namespace std; class A { public: