diff options
author | Jason Merrill <jason@redhat.com> | 2014-09-11 08:12:28 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-09-11 08:12:28 -0400 |
commit | 89632536fc913518954ea0c4b6d749d898c6a543 (patch) | |
tree | acacff546ef29f4a30f246290f3ed7e8cf6bdc20 /gcc | |
parent | 8aed2f2f63cebce1fc0c9af95df68c2d7efc52a3 (diff) | |
download | gcc-89632536fc913518954ea0c4b6d749d898c6a543.zip gcc-89632536fc913518954ea0c4b6d749d898c6a543.tar.gz gcc-89632536fc913518954ea0c4b6d749d898c6a543.tar.bz2 |
re PR c++/58678 (pykde4-4.11.2 link error (devirtualization too trigger happy))
PR c++/58678
* ipa-devirt.c (ipa_devirt): Don't check DECL_COMDAT.
From-SVN: r215168
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-devirt.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/devirt-28a.C | 15 |
3 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 014014a..f3bfbe0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-11 Jason Merrill <jason@redhat.com> + + PR c++/58678 + * ipa-devirt.c (ipa_devirt): Don't check DECL_COMDAT. + 2014-09-11 Georg-Johann Lay <avr@gjlay.de> PR target/63223 diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index f98a18e..948ae23 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -3952,8 +3952,7 @@ ipa_devirt (void) /* Don't use an implicitly-declared destructor (c++/58678). */ struct cgraph_node *non_thunk_target = likely_target->function_symbol (); - if (DECL_ARTIFICIAL (non_thunk_target->decl) - && DECL_COMDAT (non_thunk_target->decl)) + if (DECL_ARTIFICIAL (non_thunk_target->decl)) { if (dump_file) fprintf (dump_file, "Target is artificial\n\n"); diff --git a/gcc/testsuite/g++.dg/ipa/devirt-28a.C b/gcc/testsuite/g++.dg/ipa/devirt-28a.C new file mode 100644 index 0000000..bdd1682 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/devirt-28a.C @@ -0,0 +1,15 @@ +// PR c++/58678 +// { dg-options "-O3 -flto -shared -fPIC -Wl,--no-undefined" } +// { dg-do link { target { gld && fpic } } } + +struct A { + virtual ~A(); +}; +struct B : A { + virtual int m_fn1(); +}; +void fn1(B* b) { + delete b; +} + +int main() {} |