diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-19 17:35:52 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-19 17:35:52 +0000 |
commit | 506710058a3084ad6fe7eb4a393daafca550fe1e (patch) | |
tree | 8e1dc19a95064f435093c7338fbedb158000e6e5 | |
parent | ac553c6586f5e538d48a1dd0aa54aa13b967b3e3 (diff) | |
download | gcc-506710058a3084ad6fe7eb4a393daafca550fe1e.tar.gz |
Fix for PR ipa/65465.
PR ipa/65465
* cgraphunit.c (cgraph_node::create_wrapper): Correctly reset
all fields of cgraph_thunk_info.
* g++.dg/ipa/pr65465.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221518 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cgraphunit.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr65465.C | 10 |
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5e191ab7ed..86527011cea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-19 Martin Liska <mliska@suse.cz> + + PR ipa/65465 + * cgraphunit.c (cgraph_node::create_wrapper): Correctly reset + all fields of cgraph_thunk_info. + 2015-03-19 Ilya Enkovich <ilya.enkovich@intel.com> * ipa-chkp.c (chkp_maybe_create_clone): Don't try to diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index e640907550d..8ac92e1c0c8 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2484,8 +2484,9 @@ cgraph_node::create_wrapper (cgraph_node *target) /* Turn alias into thunk and expand it into GIMPLE representation. */ definition = true; + + memset (&thunk, 0, sizeof (cgraph_thunk_info)); thunk.thunk_p = true; - thunk.this_adjusting = false; create_edge (target, NULL, count, CGRAPH_FREQ_BASE); tree arguments = DECL_ARGUMENTS (decl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b625d853287..92835db1f58 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-03-19 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/ipa/pr65465.C: New test. + 2015-03-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/52659 diff --git a/gcc/testsuite/g++.dg/ipa/pr65465.C b/gcc/testsuite/g++.dg/ipa/pr65465.C new file mode 100644 index 00000000000..436d88f743f --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr65465.C @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +struct A {}; +struct B { virtual A foo () const; }; +struct C { A foo () const; }; +struct D : virtual B { A foo () const {} }; +struct F : D { virtual int bar () const; }; +int F::bar () const { return 0; } +A C::foo () const { return A (); } |