From 54e606f0b1c03b03538a467d4af3e43b201c05d7 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Fri, 25 Nov 2016 10:49:19 +0100 Subject: [PATCH] [PR 70965] Schedule extra rebuild_cgraph_edges 2016-11-25 Martin Jambor PR tree-optimization/70965 * passes.def (pass_build_ssa_passes): Add pass_rebuild_cgraph_edges. gcc/testsuite/ * g++.dg/pr70965.C: New test. From-SVN: r242867 --- gcc/ChangeLog | 5 +++++ gcc/passes.def | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/pr70965.C | 21 +++++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr70965.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0878c30be5f..1b18a47d856 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-25 Martin Jambor + + PR tree-optimization/70965 + * passes.def (pass_build_ssa_passes): Add pass_rebuild_cgraph_edges. + 2016-11-24 James Greenahlgh PR target/78509 diff --git a/gcc/passes.def b/gcc/passes.def index 2a470a7de07..b73000923b6 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_build_ssa_passes); PUSH_INSERT_PASSES_WITHIN (pass_build_ssa_passes) NEXT_PASS (pass_fixup_cfg); + NEXT_PASS (pass_rebuild_cgraph_edges); NEXT_PASS (pass_build_ssa); NEXT_PASS (pass_warn_nonnull_compare); NEXT_PASS (pass_ubsan); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e710e4b7c1d..a345e9c22d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-25 Martin Jambor + + PR tree-optimization/70965 + * g++.dg/pr70965.C: New test. + 2016-11-25 Jakub Jelinek Andreas Schwab diff --git a/gcc/testsuite/g++.dg/pr70965.C b/gcc/testsuite/g++.dg/pr70965.C new file mode 100644 index 00000000000..d8a2c35e532 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr70965.C @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -std=c++11" } */ + +struct A {}; +struct B {}; +struct C { using p = int *; template using ra = A; }; +struct J : C { template struct K { typedef C::ra o; }; }; +template struct D +{ + struct H : J::K::o { H (J::p, A) : J::K::o () {} }; + H d; + D (const char *, const A &x = A ()) : d (0, x) {} +}; +extern template class D; +enum L { M }; +struct F { virtual char *foo (); }; +template struct I : B { static int foo (int) {} }; +struct G { typedef I t; }; +void foo (int) { G::t::foo (0); } +void bar (const D &, const D &, int, L); +void baz () try { foo (0); } catch (F &e) { bar (e.foo (), "", 0, M); } -- 2.30.2