diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-09-27 02:03:23 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-09-27 00:03:23 +0000 |
commit | 8cce4dbf90c10be386e161f64c9a31366fa8a014 (patch) | |
tree | 934c1cee97381a6f7fcd2f716d67ed3cb3e3f785 /gcc | |
parent | 00eaaa505695d75765f570ec3e18680cc394a377 (diff) | |
download | gcc-8cce4dbf90c10be386e161f64c9a31366fa8a014.zip gcc-8cce4dbf90c10be386e161f64c9a31366fa8a014.tar.gz gcc-8cce4dbf90c10be386e161f64c9a31366fa8a014.tar.bz2 |
re PR middle-end/35545 (tracer pass is run too late)
PR middle-end/35545
* passes.def (pass_tracer): Move before last dominator pass.
* g++.dg/tree-prof/pr35545.C: New testcase.
From-SVN: r215651
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/passes.def | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-prof/pr35545.C | 52 |
4 files changed, 63 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 623fb7d..e3a62f5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-26 Jan Hubicka <hubicka@ucw.cz> + + PR middle-end/35545 + * passes.def (pass_tracer): Move before last dominator pass. + 2014-09-26 Thomas Schwinge <thomas@codesourcery.com> * gcc.c (try_generate_repro): Remove argument "prog". Change all diff --git a/gcc/passes.def b/gcc/passes.def index 334c670..801998f 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -252,6 +252,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_cse_reciprocals); NEXT_PASS (pass_reassoc); NEXT_PASS (pass_strength_reduction); + NEXT_PASS (pass_tracer); NEXT_PASS (pass_dominator); NEXT_PASS (pass_strlen); NEXT_PASS (pass_vrp); @@ -262,7 +263,6 @@ along with GCC; see the file COPYING3. If not see opportunities. */ NEXT_PASS (pass_phi_only_cprop); NEXT_PASS (pass_cd_dce); - NEXT_PASS (pass_tracer); NEXT_PASS (pass_dse); NEXT_PASS (pass_forwprop); NEXT_PASS (pass_phiopt); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c5562e..dd76fa5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-09-26 Jan Hubicka <hubicka@ucw.cz> + + PR middle-end/35545 + * g++.dg/tree-prof/pr35545.C: New testcase. + 2014-09-26 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.target/powerpc/pr63335.c: Change effective target to diff --git a/gcc/testsuite/g++.dg/tree-prof/pr35545.C b/gcc/testsuite/g++.dg/tree-prof/pr35545.C new file mode 100644 index 0000000..f5ff8b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-prof/pr35545.C @@ -0,0 +1,52 @@ +// devirt.cc +/* { dg-options "-O2 -fdump-ipa-profile_estimate -fdump-tree-optimized" } */ + +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; + +} +/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call" "profile_estimate" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ +/* { dg-final-use { scan-ipa-dump-not "OBJ_TYPE_REF" "optimized" } } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ |