diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-01-19 11:57:41 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-01-19 11:57:41 +0000 |
commit | 72a985d7375713a81ebfaf6e9f34ed6241f629e7 (patch) | |
tree | f304db9cdc8550c316d6ea4709de8f5b53d0d35d | |
parent | bcd3678db9fd88221d9f5974750a2514a3f2cff8 (diff) | |
download | gcc-72a985d7375713a81ebfaf6e9f34ed6241f629e7.tar.gz |
PR lto/69133
* cgraphunit.c (cgraph_node::expand_thunk): When forcing gimple
assume that the node has body.
* cgraph.c (cgraph_node::get_untransformed_body): Use gimple_body_p
check.
* g++.dg/lto/pr69133_0.C: New testcase.
* g++.dg/lto/pr69133_1.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232552 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cgraph.c | 6 | ||||
-rw-r--r-- | gcc/cgraphunit.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr69133_0.C | 19 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr69133_1.C | 22 |
6 files changed, 62 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b2423f24b61..717330d16fc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2016-01-19 Jan Hubicka <hubicka@ucw.cz> + PR lto/69133 + * cgraphunit.c (cgraph_node::expand_thunk): When forcing gimple + assume that the node has body. + * cgraph.c (cgraph_node::get_untransformed_body): Use gimple_body_p + check. + +2016-01-19 Jan Hubicka <hubicka@ucw.cz> + * lto-streamer-out.c (lto_output): Do not stream instrumentation thunks. diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 0d70904b5e8..5331f7f373b 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -3305,10 +3305,12 @@ cgraph_node::get_untransformed_body (void) size_t len; tree decl = this->decl; - if (DECL_RESULT (decl)) + /* Check if body is already there. Either we have gimple body or + the function is thunk and in that case we set DECL_ARGUMENTS. */ + if (DECL_ARGUMENTS (decl) || gimple_has_body_p (decl)) return false; - gcc_assert (in_lto_p); + gcc_assert (in_lto_p && !DECL_RESULT (decl)); timevar_push (TV_IPA_LTO_GIMPLE_IN); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 950f6c5c917..2c49d7b0ac5 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1664,7 +1664,9 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) greturn *ret; bool alias_is_noreturn = TREE_THIS_VOLATILE (alias); - if (in_lto_p) + /* We may be called from expand_thunk that releses body except for + DECL_ARGUMENTS. In this case force_gimple_thunk is true. */ + if (in_lto_p && !force_gimple_thunk) get_untransformed_body (); a = DECL_ARGUMENTS (thunk_fndecl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc476b96b80..6f9a2a64c1b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-01-19 Jan Hubicka <hubicka@ucw.cz> + + PR lto/69133 + * g++.dg/lto/pr69133_0.C: New testcase. + * g++.dg/lto/pr69133_1.C: New testcase. + 2016-01-15 Jeff Law <law@redhat.com> PR tree-optimization/69320 diff --git a/gcc/testsuite/g++.dg/lto/pr69133_0.C b/gcc/testsuite/g++.dg/lto/pr69133_0.C new file mode 100644 index 00000000000..bd667074b7b --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr69133_0.C @@ -0,0 +1,19 @@ +// { dg-lto-do link } +// { dg-lto-options { { -flto -O2 } } } +// { dg-extra-ld-options "-r -nostdlib -flto -flto-partition=none -O2" } +namespace xercesc_3_1 { +class XMLEntityHandler { +public: + virtual ~XMLEntityHandler(); + virtual void m_fn1(); + virtual bool m_fn2(); + virtual void m_fn3(); + virtual int m_fn4(); + virtual void m_fn5(); +} * a; +void fn1() { + a->m_fn5(); + a->m_fn1(); +} +} + diff --git a/gcc/testsuite/g++.dg/lto/pr69133_1.C b/gcc/testsuite/g++.dg/lto/pr69133_1.C new file mode 100644 index 00000000000..24c477d73c3 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr69133_1.C @@ -0,0 +1,22 @@ +namespace xercesc_3_1 { +class A { + virtual void m_fn1(); +}; +class XMLEntityHandler { +public: + virtual ~XMLEntityHandler(); + virtual void m_fn2(const int &); + virtual bool m_fn3(); + virtual void m_fn4(); + virtual int m_fn5() = 0; + virtual void m_fn6(const int &); +}; +class B : A, XMLEntityHandler {}; +class C : B { + void m_fn2(const int &); + void m_fn6(const int &); +}; +void C::m_fn2(const int &) {} +void C::m_fn6(const int &) {} +} + |