Commit 3c4fa8a8 by Martin Jambor

Add a few missing checks that IPA_NODE_REF is not NULL (PR 92454)

2019-11-13  Jan Hubicka  <hubicka@ucw.cz>
	    Martin Jambor  <mjambor@suse.cz>

	PR ipa/92454
	* ipa-cp.c (spread_undeadness): Check that IPA_NODE_REF exists.
	(identify_dead_nodes): Likewise.

	testsuite/
	* g++.dg/ipa/pr92454.C: New test.

From-SVN: r278142
parent a5e2beb9
2019-11-13 Jan Hubicka <hubicka@ucw.cz>
Martin Jambor <mjambor@suse.cz>
PR ipa/92454
* ipa-cp.c (spread_undeadness): Check that IPA_NODE_REF exists.
(identify_dead_nodes): Likewise.
2019-11-13 Martin Liska <mliska@suse.cz> 2019-11-13 Martin Liska <mliska@suse.cz>
* ipa-icf.c (sem_function::equals_private): Do not overuse * ipa-icf.c (sem_function::equals_private): Do not overuse
...@@ -4979,7 +4979,7 @@ spread_undeadness (struct cgraph_node *node) ...@@ -4979,7 +4979,7 @@ spread_undeadness (struct cgraph_node *node)
callee = cs->callee->function_symbol (NULL); callee = cs->callee->function_symbol (NULL);
info = IPA_NODE_REF (callee); info = IPA_NODE_REF (callee);
if (info->node_dead) if (info && info->node_dead)
{ {
info->node_dead = 0; info->node_dead = 0;
spread_undeadness (callee); spread_undeadness (callee);
...@@ -5017,18 +5017,19 @@ identify_dead_nodes (struct cgraph_node *node) ...@@ -5017,18 +5017,19 @@ identify_dead_nodes (struct cgraph_node *node)
struct cgraph_node *v; struct cgraph_node *v;
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle) for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (v->local if (v->local
&& IPA_NODE_REF (v)
&& !v->call_for_symbol_thunks_and_aliases && !v->call_for_symbol_thunks_and_aliases
(has_undead_caller_from_outside_scc_p, NULL, true)) (has_undead_caller_from_outside_scc_p, NULL, true))
IPA_NODE_REF (v)->node_dead = 1; IPA_NODE_REF (v)->node_dead = 1;
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle) for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (!IPA_NODE_REF (v)->node_dead) if (IPA_NODE_REF (v) && !IPA_NODE_REF (v)->node_dead)
spread_undeadness (v); spread_undeadness (v);
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle) for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (IPA_NODE_REF (v)->node_dead) if (IPA_NODE_REF (v) && IPA_NODE_REF (v)->node_dead)
fprintf (dump_file, " Marking node as dead: %s.\n", v->dump_name ()); fprintf (dump_file, " Marking node as dead: %s.\n", v->dump_name ());
} }
} }
......
2019-11-13 Martin Jambor <mjambor@suse.cz>
PR ipa/92454
* ipa-cp.c (spread_undeadness): Check that IPA_NODE_REF exists.
(identify_dead_nodes): Likewise.
2019-11-13 Martin Liska <mliska@suse.cz> 2019-11-13 Martin Liska <mliska@suse.cz>
* gcc.dg/ipa/ipa-icf-39.c: Update -fdbg-cnt to the new format. * gcc.dg/ipa/ipa-icf-39.c: Update -fdbg-cnt to the new format.
......
/* Originally PR ipa/91969, options adjusted for PR ipa/92454 */
/* { dg-options "-O3 --param ipa-cp-eval-threshold=1" } */
enum by
{
};
class A
{
public:
class B
{
public:
virtual void m_fn2 (by) = 0;
};
virtual int m_fn1 ();
B *cf;
};
by a;
class C : A, A::B
{
void m_fn2 (by);
};
void C::m_fn2 (by) { cf->m_fn2 (a); }
struct a
{
virtual ~a ();
};
struct b
{
virtual void d (...);
};
struct c : a, b
{
void 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