Commit 4a414de8 by Martin Jambor Committed by Martin Jambor

[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
parent b15f0273
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> 2015-12-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/66688 PR tree-optimization/66688
...@@ -2592,7 +2592,8 @@ collect_callers_of_node_1 (cgraph_node *node, void *data) ...@@ -2592,7 +2592,8 @@ collect_callers_of_node_1 (cgraph_node *node, void *data)
if (avail > AVAIL_INTERPOSABLE) if (avail > AVAIL_INTERPOSABLE)
for (cs = node->callers; cs != NULL; cs = cs->next_caller) 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); redirect_callers->safe_push (cs);
return false; return false;
} }
......
...@@ -1070,7 +1070,7 @@ public: ...@@ -1070,7 +1070,7 @@ public:
cgraph_edge *get_edge (gimple *call_stmt); cgraph_edge *get_edge (gimple *call_stmt);
/* Collect all callers of cgraph_node and its aliases that are known to lead /* 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); vec<cgraph_edge *> collect_callers (void);
/* Remove all callers from the node. */ /* Remove all callers from the node. */
......
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> 2015-12-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/63506 PR c++/63506
......
// { 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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment