Commit 8472fa80 by Markus Trippelsdorf Committed by Jan Hubicka

re PR ipa/60058 (internal compiler error: Segmentation fault)


	PR ipa/60058
	* ipa-cp.c (ipa_get_indirect_edge_target_1): Check that target
	is non-null.
	* g++.dg/torture/pr60058.C: New testcase.

From-SVN: r207478
parent df98e37f
2014-02-04 Markus Trippelsdorf <markus@trippelsdorf.de>
PR ipa/60058
* ipa-cp.c (ipa_get_indirect_edge_target_1): Check that target
is non-null.
2014-02-04 Jan Hubicka <hubicka@ucw.cz> 2014-02-04 Jan Hubicka <hubicka@ucw.cz>
* gimple-fold.c (can_refer_decl_in_current_unit_p): Default visibility is safe. * gimple-fold.c (can_refer_decl_in_current_unit_p): Default visibility is safe.
......
...@@ -1573,6 +1573,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, ...@@ -1573,6 +1573,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
{ {
target = gimple_get_virt_method_for_vtable (ie->indirect_info->otr_token, target = gimple_get_virt_method_for_vtable (ie->indirect_info->otr_token,
vtable, offset); vtable, offset);
if (target)
{
if ((TREE_CODE (TREE_TYPE (target)) == FUNCTION_TYPE if ((TREE_CODE (TREE_TYPE (target)) == FUNCTION_TYPE
&& DECL_FUNCTION_CODE (target) == BUILT_IN_UNREACHABLE) && DECL_FUNCTION_CODE (target) == BUILT_IN_UNREACHABLE)
|| !possible_polymorphic_call_target_p || !possible_polymorphic_call_target_p
...@@ -1589,6 +1591,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, ...@@ -1589,6 +1591,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
return target; return target;
} }
} }
}
/* Did we work out BINFO via type propagation? */ /* Did we work out BINFO via type propagation? */
if (!t && known_binfos.length () > (unsigned int) param_index) if (!t && known_binfos.length () > (unsigned int) param_index)
......
2014-02-04 Markus Trippelsdorf <markus@trippelsdorf.de>
PR ipa/60058
* g++.dg/torture/pr60058.C: New testcase.
2014-02-04 Max Ostapenko <m.ostapenko@partner.samsung.com> 2014-02-04 Max Ostapenko <m.ostapenko@partner.samsung.com>
* g++.dg/tsan/default_options.C: Invert check. * g++.dg/tsan/default_options.C: Invert check.
......
/* { dg-do compile } */
/* { dg-require-visibility "" } */
typedef enum {} UErrorCode;
class A {
public:
virtual A &m_fn1(A &, const A &, UErrorCode &) const;
void m_fn2();
A();
A(int);
};
class __attribute__((visibility("hidden"))) B : public A {
public:
B(A &p1) : norm2(p1), set(0) {}
A &m_fn1(A &, const A &, UErrorCode &) const;
A &norm2;
const int &set;
};
UErrorCode a;
A c;
void fn1(A *p1) {
A b;
p1->m_fn1(b, 0, a).m_fn2();
}
void fn2() {
B d(c);
fn1(&d);
}
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