> Disabling devirtualization reduces code size, both for instrumentation > (because > many more virtual functions are kept longer and therefore instrumented) and > for > normal optimization.
Can you refer bit more on the problem? Full devirtualization should not increase code size, speculative devirtualization does somewhat, but by sub 1%. Honza > > Patch attached. Passes internal testing and regression tests. Ok for > google/4_9? > > Thanks, > Teresa > > -- > Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413 > Disabling devirtualization reduces code size, both for instrumentation > (because > many more virtual functions are kept longer and therefore instrumented) and > for > normal optimization. > > Passes internal testing and regression tests. Ok for google/4_9? > > 2014-10-18 Teresa Johnson <tejohn...@google.com> > > gcc/: > Google ref b/17945455 > * opts.c (finish_options): Disable -fdevirtualize > > gcc/testsuite/: > Google ref b/17945455 > * testsuite/g++.dg/ipa/devirt-10.C: Enable devirtualization for test. > * testsuite/g++.dg/ipa/devirt-11.C: Ditto. > * testsuite/g++.dg/ipa/devirt-12.C: Ditto. > * testsuite/g++.dg/ipa/devirt-13.C: Ditto. > * testsuite/g++.dg/ipa/devirt-14.C: Ditto. > * testsuite/g++.dg/ipa/devirt-15.C: Ditto. > * testsuite/g++.dg/ipa/devirt-16.C: Ditto. > * testsuite/g++.dg/ipa/devirt-17.C: Ditto. > * testsuite/g++.dg/ipa/devirt-18.C: Ditto. > * testsuite/g++.dg/ipa/devirt-19.C: Ditto. > * testsuite/g++.dg/ipa/devirt-1.C: Ditto. > * testsuite/g++.dg/ipa/devirt-20.C: Ditto. > * testsuite/g++.dg/ipa/devirt-21.C: Ditto. > * testsuite/g++.dg/ipa/devirt-22.C: Ditto. > * testsuite/g++.dg/ipa/devirt-23.C: Ditto. > * testsuite/g++.dg/ipa/devirt-24.C: Ditto. > * testsuite/g++.dg/ipa/devirt-25.C: Ditto. > * testsuite/g++.dg/ipa/devirt-26.C: Ditto. > * testsuite/g++.dg/ipa/devirt-27.C: Ditto. > * testsuite/g++.dg/ipa/devirt-28.C: Ditto. > * testsuite/g++.dg/ipa/devirt-29.C: Ditto. > * testsuite/g++.dg/ipa/devirt-2.C: Ditto. > * testsuite/g++.dg/ipa/devirt-30.C: Ditto. > * testsuite/g++.dg/ipa/devirt-31.C: Ditto. > * testsuite/g++.dg/ipa/devirt-39.C: Ditto. > * testsuite/g++.dg/ipa/devirt-3.C: Ditto. > * testsuite/g++.dg/ipa/devirt-4.C: Ditto. > * testsuite/g++.dg/ipa/devirt-5.C: Ditto. > * testsuite/g++.dg/ipa/devirt-6.C: Ditto. > * testsuite/g++.dg/ipa/devirt-7.C: Ditto. > * testsuite/g++.dg/ipa/devirt-9.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-1.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-2.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-3.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-4.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-5.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-6.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-7.C: Ditto. > * testsuite/g++.dg/ipa/devirt-c-8.C: Ditto. > * testsuite/g++.dg/ipa/devirt-d-1.C: Ditto. > * testsuite/g++.dg/ipa/devirt-g-1.C: Ditto. > * testsuite/g++.dg/ipa/imm-devirt-1.C: Ditto. > * testsuite/g++.dg/ipa/imm-devirt-2.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-1.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-2.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-3.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-4.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-5.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-7.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-8.C: Ditto. > * testsuite/g++.dg/ipa/ivinline-9.C: Ditto. > * testsuite/g++.dg/ipa/pr60600.C: Ditto. > * testsuite/g++.dg/ipa/pr60640-4.C: Ditto. > * testsuite/g++.dg/ipa/type-inheritance-1.C: Ditto. > * testsuite/g++.dg/opt/devirt1.C: Ditto. > * testsuite/g++.dg/opt/devirt2.C: Ditto. > * testsuite/g++.dg/opt/devirt3.C: Ditto. > > Index: opts.c > =================================================================== > --- opts.c (revision 216286) > +++ opts.c (working copy) > @@ -485,7 +485,6 @@ static const struct default_options default_option > { OPT_LEVELS_2_PLUS, OPT_ftree_pre, NULL, 1 }, > { OPT_LEVELS_2_PLUS, OPT_ftree_switch_conversion, NULL, 1 }, > { OPT_LEVELS_2_PLUS, OPT_fipa_cp, NULL, 1 }, > - { OPT_LEVELS_2_PLUS, OPT_fdevirtualize, NULL, 1 }, > { OPT_LEVELS_2_PLUS, OPT_fdevirtualize_speculatively, NULL, 1 }, > { OPT_LEVELS_2_PLUS, OPT_fipa_sra, NULL, 1 }, > { OPT_LEVELS_2_PLUS, OPT_falign_loops, NULL, 1 }, > Index: testsuite/g++.dg/ipa/devirt-10.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-10.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-10.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fdump-ipa-cp -fno-early-inlining" } > */ > +/* { dg-options "-O3 -fdump-ipa-inline -fdump-ipa-cp -fno-early-inlining > -fdevirtualize" } */ > class wxPaintEvent { }; > struct wxDCBase > { > Index: testsuite/g++.dg/ipa/devirt-11.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-11.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-11.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-ipa-inline --param=early-inlining-insns-comdat=0 > -fno-devirtualize-speculatively" } */ > +/* { dg-options "-O2 -fdump-ipa-inline --param=early-inlining-insns-comdat=0 > -fno-devirtualize-speculatively -fdevirtualize" } */ > int baz (); > struct A > { > Index: testsuite/g++.dg/ipa/devirt-12.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-12.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-12.C (working copy) > @@ -1,5 +1,5 @@ > // { dg-do compile { target c++11 } } > -// { dg-options "-O -fdump-ipa-inline" } > +// { dg-options "-O -fdump-ipa-inline -fdevirtualize" } > > class Foo > { > Index: testsuite/g++.dg/ipa/devirt-13.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-13.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-13.C (working copy) > @@ -1,6 +1,6 @@ > /* { dg-do run } */ > /* Call to foo should be devirtualized because there are no derived types of > A. */ > -/* { dg-options "-O2 -fdump-tree-ssa" } */ > +/* { dg-options "-O2 -fdump-tree-ssa -fdevirtualize" } */ > namespace { > class A { > public: > Index: testsuite/g++.dg/ipa/devirt-14.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-14.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-14.C (working copy) > @@ -2,7 +2,7 @@ > because the constructor of A is unreachable and therefore the virtual > method table referring to A::foo is optimized out. */ > /* { dg-do run } */ > -/* { dg-options "-O2 -fdump-tree-ssa" } */ > +/* { dg-options "-O2 -fdump-tree-ssa -fdevirtualize" } */ > class B { > public: > virtual int foo(void) > Index: testsuite/g++.dg/ipa/devirt-15.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-15.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-15.C (working copy) > @@ -1,7 +1,7 @@ > /* Check that we speculatively devirutalize call to FOO to B::foo becuase > A is noreturn. */ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-ipa-devirt -fdump-tree-optimized" } */ > +/* { dg-options "-O2 -fdump-ipa-devirt -fdump-tree-optimized -fdevirtualize" > } */ > class A { > public: > virtual int foo(void) > Index: testsuite/g++.dg/ipa/devirt-16.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-16.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-16.C (working copy) > @@ -1,7 +1,7 @@ > /* We shall devirtualize to unreachable. No anonymous type method should > surivve > reachability. */ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-ipa-whole-program" } */ > +/* { dg-options "-O2 -fdump-ipa-whole-program -fdevirtualize" } */ > namespace { > class B { > public: > Index: testsuite/g++.dg/ipa/devirt-17.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-17.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-17.C (working copy) > @@ -1,7 +1,7 @@ > /* We shall devirtualize to B::foo since it is the only live candidate of an > anonymous type. */ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-ipa-whole-program" } */ > +/* { dg-options "-O2 -fdump-ipa-whole-program -fdevirtualize" } */ > namespace { > class B { > public: > Index: testsuite/g++.dg/ipa/devirt-18.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-18.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-18.C (working copy) > @@ -1,7 +1,7 @@ > /* We shall devirtualize to unreachable. No anonymous type method should > surivve > reachability. */ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-tree-ssa" } */ > +/* { dg-options "-O2 -fdump-tree-ssa -fdevirtualize" } */ > namespace { > class B { > public: > Index: testsuite/g++.dg/ipa/devirt-19.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-19.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-19.C (working copy) > @@ -2,7 +2,7 @@ > Previously we were failing by considering CLOBBER statement to be > a type change. */ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-ipa-cp" } */ > +/* { dg-options "-O2 -fdump-ipa-cp -fdevirtualize" } */ > struct A { > void operator==(const A &); > }; > Index: testsuite/g++.dg/ipa/devirt-1.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-1.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-1.C (working copy) > @@ -1,6 +1,6 @@ > /* Verify that simple virtual calls are converted to direct calls by ipa-cp. > */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-20.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-20.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-20.C (working copy) > @@ -1,6 +1,6 @@ > #include <stdlib.h> > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-tree-release_ssa" } */ > +/* { dg-options "-O2 -fdump-tree-release_ssa -fdevirtualize" } */ > namespace { > struct A > { int a; virtual int foo() {return a;} void bar() {a=7;} }; > Index: testsuite/g++.dg/ipa/devirt-21.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-21.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-21.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-ipa-sra -fdump-ipa-cp" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-ipa-sra -fdump-ipa-cp > -fdevirtualize" } */ > /* Main purpose is to verify that we do not produce wrong devirtualization to > C::m_fn1. We currently devirtualize to B::m_fn1, so check that. */ > #include <stdlib.h> > Index: testsuite/g++.dg/ipa/devirt-22.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-22.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-22.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-ipa-sra -fdump-ipa-cp" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-ipa-sra -fdump-ipa-cp > -fdevirtualize" } */ > class A {}; > class B { > public: > Index: testsuite/g++.dg/ipa/devirt-23.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-23.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-23.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-partial-inlining -fdump-ipa-cp > -fno-devirtualize-speculatively" } */ > +/* { dg-options "-O3 -fno-partial-inlining -fdump-ipa-cp > -fno-devirtualize-speculatively -fdevirtualize" } */ > /* Main purpose is to verify that we do not produce wrong devirtualization to > C::m_fn1. We currently devirtualize to B::m_fn1, so check that. */ > #include <stdlib.h> > Index: testsuite/g++.dg/ipa/devirt-24.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-24.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-24.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-inline -fdump-ipa-cp > --param=early-inlining-insns-comdat=0" } */ > +/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-inline -fdump-ipa-cp > --param=early-inlining-insns-comdat=0 -fdevirtualize" } */ > void pad(void); > class A {}; > class B { > Index: testsuite/g++.dg/ipa/devirt-25.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-25.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-25.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O3 -fdump-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-cp -fdevirtualize" } */ > > class ert_RefCounter { > protected: > Index: testsuite/g++.dg/ipa/devirt-26.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-26.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-26.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O3 -fdump-ipa-devirt" } */ > +/* { dg-options "-O3 -fdump-ipa-devirt -fdevirtualize" } */ > struct A > { > int a; > Index: testsuite/g++.dg/ipa/devirt-27.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-27.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-27.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O3 -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fdump-tree-optimized -fdevirtualize" } */ > struct A > { > int a; > Index: testsuite/g++.dg/ipa/devirt-28.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-28.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-28.C (working copy) > @@ -1,5 +1,5 @@ > // PR c++/58678 > -// { dg-options "-O3 -fdump-ipa-devirt" } > +// { dg-options "-O3 -fdump-ipa-devirt -fdevirtualize" } > > struct A { > virtual ~A(); > Index: testsuite/g++.dg/ipa/devirt-29.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-29.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-29.C (working copy) > @@ -1,7 +1,7 @@ > /* { dg-do run { target c++11 } } */ > /* There is a devirtualizable call. In PR60306 we deduced wrong target to > cxa_pure_virtual. > For gcc 4.10 we temporarily disable the devirtualization. */ > -/* { dg-options "-O3" } */ > +/* { dg-options "-O3 -fdevirtualize" } */ > > #include <vector> > > Index: testsuite/g++.dg/ipa/devirt-2.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-2.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-2.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that simple virtual calls using this pointer are converted > to direct calls by ipa-cp. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-30.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-30.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-30.C (working copy) > @@ -1,5 +1,5 @@ > // PR c++/58678 > -// { dg-options "-O3 -fdump-ipa-devirt" } > +// { dg-options "-O3 -fdump-ipa-devirt -fdevirtualize" } > > // We shouldn't speculatively devirtualize to ~B because B is an abstract > // class; any actual object passed to f will be of some derived class which > Index: testsuite/g++.dg/ipa/devirt-31.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-31.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-31.C (working copy) > @@ -1,4 +1,4 @@ > -/* { dg-options "-O2 -std=c++11 -fdump-ipa-inline" } */ > +/* { dg-options "-O2 -std=c++11 -fdump-ipa-inline -fdevirtualize" } */ > #include <new> > > class EmbeddedObject { > Index: testsuite/g++.dg/ipa/devirt-39.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-39.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-39.C (working copy) > @@ -1,5 +1,5 @@ > // PR c++/61214 > -/* { dg-options "-O2 -fdump-tree-optimized" } */ > +/* { dg-options "-O2 -fdump-tree-optimized -fdevirtualize" } */ > > struct Base > { > Index: testsuite/g++.dg/ipa/devirt-3.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-3.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-3.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that simple virtual calls on an object refrence are > converted to simple calls by ipa-cp. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-4.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-4.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-4.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-co can convert virtual calls to direct ones even > when a typecast to an ancestor is involved along the way. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-5.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-5.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-5.C (working copy) > @@ -2,7 +2,7 @@ > ones even when a typecast to an ancestor is involved along the way > and that ancestor is not the first one with virtual functions. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-6.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-6.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-6.C (working copy) > @@ -2,7 +2,7 @@ > spot that foo changes the dynamic type of the passed object. */ > > /* { dg-do run } */ > -/* { dg-options "-O3" } */ > +/* { dg-options "-O3 -fdevirtualize" } */ > > extern "C" void abort (void); > extern "C" void *malloc(__SIZE_TYPE__); > Index: testsuite/g++.dg/ipa/devirt-7.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-7.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-7.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that IPA-CP can do devirtualization even if the virtual call > comes from a method that has been early-inlined into a descendant. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fdump-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-cp -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-9.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-9.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-9.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-ipa-whole-program > --param=early-inlining-insns-comdat=0" } */ > +/* { dg-options "-O2 -fdump-ipa-whole-program > --param=early-inlining-insns-comdat=0 -fdevirtualize" } */ > double foo (); > struct B > { > Index: testsuite/g++.dg/ipa/devirt-c-1.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-1.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-1.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under construction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-c-2.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-2.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-2.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under construction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-c-3.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-3.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-3.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under construction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-inline" } */ > +/* { dg-options "-O3 -fno-inline -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-c-4.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-4.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-4.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under construction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-inline" } */ > +/* { dg-options "-O3 -fno-inline -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-c-5.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-5.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-5.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under construction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-c-6.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-6.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-6.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under construction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-inline" } */ > +/* { dg-options "-O3 -fno-inline -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-c-7.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-7.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-7.C (working copy) > @@ -2,7 +2,7 @@ > object within another one when looking for dynamic type change . */ > /* { dg-do run } */ > /* { dg-require-effective-target nonpic } */ > -/* { dg-options "-O3 -Wno-attributes" } */ > +/* { dg-options "-O3 -Wno-attributes -fdevirtualize" } */ > > extern "C" void abort (void); > namespace std { > Index: testsuite/g++.dg/ipa/devirt-c-8.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-c-8.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-c-8.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under construction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdump-ipa-cp > -fdump-tree-optimized -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-d-1.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-d-1.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-d-1.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that ipa-cp correctly detects the dynamic type of an object > under destruction when doing devirtualization. */ > /* { dg-do run } */ > -/* { dg-options "-O3 -fno-early-inlining -fno-inline" } */ > +/* { dg-options "-O3 -fno-early-inlining -fno-inline -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/devirt-g-1.C > =================================================================== > --- testsuite/g++.dg/ipa/devirt-g-1.C (revision 216286) > +++ testsuite/g++.dg/ipa/devirt-g-1.C (working copy) > @@ -1,5 +1,5 @@ > // { dg-do compile } > -// { dg-options "-O2 -fdump-ipa-cp -fdump-tree-optimized" } > +// { dg-options "-O2 -fdump-ipa-cp -fdump-tree-optimized -fdevirtualize" } > > struct S { S(); virtual void xyzzy(); void otherstuff(); }; > struct R { int a; S s; R(); }; > Index: testsuite/g++.dg/ipa/imm-devirt-1.C > =================================================================== > --- testsuite/g++.dg/ipa/imm-devirt-1.C (revision 216286) > +++ testsuite/g++.dg/ipa/imm-devirt-1.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that virtual calls are folded even early inlining puts them into > one > function with the definition. */ > /* { dg-do run } */ > -/* { dg-options "-O2 -fdump-tree-fre1-details" } */ > +/* { dg-options "-O2 -fdump-tree-fre1-details -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/imm-devirt-2.C > =================================================================== > --- testsuite/g++.dg/ipa/imm-devirt-2.C (revision 216286) > +++ testsuite/g++.dg/ipa/imm-devirt-2.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that virtual calls are folded even early inlining puts them into > one > function with the definition. */ > /* { dg-do run } */ > -/* { dg-options "-O2 -fdump-tree-fre1-details" } */ > +/* { dg-options "-O2 -fdump-tree-fre1-details -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-1.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-1.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-1.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that simple virtual calls are inlined even without early > inlining. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-2.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-2.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-2.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that simple virtual calls using this pointer are inlined > even without early inlining.. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-3.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-3.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-3.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that simple virtual calls on an object refrence are inlined > even without early inlining. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-4.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-4.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-4.C (working copy) > @@ -2,7 +2,7 @@ > inlining, even when a typecast to an ancestor is involved along the > way. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-5.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-5.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-5.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that virtual call inlining does not pick a wrong method when > there is a user defined ancestor in an object. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-7.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-7.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-7.C (working copy) > @@ -2,7 +2,7 @@ > inlining, even when a typecast to an ancestor is involved along the > way and that ancestor is not the first one with virtual functions. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-8.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-8.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-8.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that virtual calls are inlined (ithout early inlining) even > when their caller is itself indirectly inlined. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/ivinline-9.C > =================================================================== > --- testsuite/g++.dg/ipa/ivinline-9.C (revision 216286) > +++ testsuite/g++.dg/ipa/ivinline-9.C (working copy) > @@ -3,7 +3,7 @@ > way and that ancestor itself has an ancestor wich is not the > primary base class. */ > /* { dg-do run { target nonpic } } */ > -/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp > -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/ipa/pr60600.C > =================================================================== > --- testsuite/g++.dg/ipa/pr60600.C (revision 216286) > +++ testsuite/g++.dg/ipa/pr60600.C (working copy) > @@ -1,5 +1,5 @@ > /* { dg-do compile } */ > -/* { dg-options "-O3 -fdump-ipa-cp" } */ > +/* { dg-options "-O3 -fdump-ipa-cp -fdevirtualize" } */ > > struct data { > data(int); > Index: testsuite/g++.dg/ipa/pr60640-4.C > =================================================================== > --- testsuite/g++.dg/ipa/pr60640-4.C (revision 216286) > +++ testsuite/g++.dg/ipa/pr60640-4.C (working copy) > @@ -1,5 +1,5 @@ > // { dg-do run } > -// { dg-options "-O3 -fdump-ipa-cp" } > +// { dg-options "-O3 -fdump-ipa-cp -fdevirtualize" } > > struct Distraction > { > Index: testsuite/g++.dg/ipa/type-inheritance-1.C > =================================================================== > --- testsuite/g++.dg/ipa/type-inheritance-1.C (revision 216286) > +++ testsuite/g++.dg/ipa/type-inheritance-1.C (working copy) > @@ -1,7 +1,7 @@ > /* Verify that callgraph construction keeps FOO for possible devirtualization > and removes BAR. */ > /* { dg-do compile } */ > -/* { dg-options "-O2 -fdump-ipa-visibility" } */ > +/* { dg-options "-O2 -fdump-ipa-visibility -fdevirtualize" } */ > > extern "C" void abort (void); > > Index: testsuite/g++.dg/opt/devirt1.C > =================================================================== > --- testsuite/g++.dg/opt/devirt1.C (revision 216286) > +++ testsuite/g++.dg/opt/devirt1.C (working copy) > @@ -1,5 +1,5 @@ > // { dg-do compile } > -// { dg-options "-O2" } > +// { dg-options "-O2 -fdevirtualize" } > // { dg-final { scan-assembler "xyzzy" } } > > struct S { S(); virtual void xyzzy(); }; > Index: testsuite/g++.dg/opt/devirt2.C > =================================================================== > --- testsuite/g++.dg/opt/devirt2.C (revision 216286) > +++ testsuite/g++.dg/opt/devirt2.C (working copy) > @@ -1,5 +1,5 @@ > // { dg-do compile } > -// { dg-options "-O2" } > +// { dg-options "-O2 -fdevirtualize" } > /* Using -mshort-calls avoids loading the function addresses in > registers and thus getting the counts wrong. */ > // { dg-additional-options "-mshort-calls" {target epiphany-*-*} } > Index: testsuite/g++.dg/opt/devirt3.C > =================================================================== > --- testsuite/g++.dg/opt/devirt3.C (revision 216286) > +++ testsuite/g++.dg/opt/devirt3.C (working copy) > @@ -1,5 +1,5 @@ > // { dg-do compile } > -// { dg-options "-O2" } > +// { dg-options "-O2 -fdevirtualize" } > > class ert_RefCounter { > protected: