diff options
author | Martin Jambor <mjambor@suse.cz> | 2015-12-15 14:07:15 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2015-12-15 14:07:15 +0100 |
commit | 4a414de84a8e51b60b0be0c6c3ad9c33f7310d92 (patch) | |
tree | 062c93856d8ecd5b8d3539d305d0f33b8f624de8 | |
parent | b15f02734659e9babcb743e368b40f57f60c0b48 (diff) | |
download | gcc-4a414de84a8e51b60b0be0c6c3ad9c33f7310d92.zip gcc-4a414de84a8e51b60b0be0c6c3ad9c33f7310d92.tar.gz gcc-4a414de84a8e51b60b0be0c6c3ad9c33f7310d92.tar.bz2 |
[PR 68851] Do not collect thunks in collect_callers
2015-12-15 Martin Jambor <mjambor@suse.cz>
PR ipa/68851
* cgraph.c (collect_callers_of_node_1): Do not collect thunks.
* cgraph.h (cgraph_node): Change comment of collect_callers.
testsuite/
* g++.dg/ipa/pr68851.C: New test.
From-SVN: r231648
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cgraph.c | 3 | ||||
-rw-r--r-- | gcc/cgraph.h | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr68851.C | 29 |
5 files changed, 43 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e36f0ed..9b81b481 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-15 Martin Jambor <mjambor@suse.cz> + + PR ipa/68851 + * cgraph.c (collect_callers_of_node_1): Do not collect thunks. + * cgraph.h (cgraph_node): Change comment of collect_callers. + 2015-12-15 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/66688 diff --git a/gcc/cgraph.c b/gcc/cgraph.c index c8c3370..5a9c2a2 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -2592,7 +2592,8 @@ collect_callers_of_node_1 (cgraph_node *node, void *data) if (avail > AVAIL_INTERPOSABLE) for (cs = node->callers; cs != NULL; cs = cs->next_caller) - if (!cs->indirect_inlining_edge) + if (!cs->indirect_inlining_edge + && !cs->caller->thunk.thunk_p) redirect_callers->safe_push (cs); return false; } diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 0a09391..ba14215 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1070,7 +1070,7 @@ public: cgraph_edge *get_edge (gimple *call_stmt); /* Collect all callers of cgraph_node and its aliases that are known to lead - to NODE (i.e. are not overwritable). */ + to NODE (i.e. are not overwritable) and that are not thunks. */ vec<cgraph_edge *> collect_callers (void); /* Remove all callers from the node. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4d749f1..d08b400 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-12-15 Martin Jambor <mjambor@suse.cz> + + PR ipa/68851 + * g++.dg/ipa/pr68851.C: New test. + 2015-12-15 Paolo Carlini <paolo.carlini@oracle.com> PR c++/63506 diff --git a/gcc/testsuite/g++.dg/ipa/pr68851.C b/gcc/testsuite/g++.dg/ipa/pr68851.C new file mode 100644 index 0000000..659e4cd --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr68851.C @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-O3" } + +class A; +class B { +public: + operator A *() const; +}; +class A { +public: + virtual bool isFormControlElement() const {} +}; +class C { + struct D { + B element; + }; + bool checkPseudoClass(const D &, int &) const; +}; +class F { + virtual bool isFormControlElement() const; +}; +class G : A, F { + bool isFormControlElement() const {} +}; +bool C::checkPseudoClass(const D &p1, int &) const { + A &a = *p1.element; + a.isFormControlElement(); + a.isFormControlElement() || a.isFormControlElement(); +} |