diff options
author | Martin Jambor <jamborm@gcc.gnu.org> | 2019-11-13 15:12:58 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2019-11-13 15:12:58 +0100 |
commit | 3c4fa8a8562d3788bb763ca5c8fb1563b8d4eb1a (patch) | |
tree | 11dab553096d09c1384c5f74989cbf201c06130a /gcc/ipa-cp.c | |
parent | a5e2beb9474fc0bd4210926d75ec1101a3f11412 (diff) | |
download | gcc-3c4fa8a8562d3788bb763ca5c8fb1563b8d4eb1a.zip gcc-3c4fa8a8562d3788bb763ca5c8fb1563b8d4eb1a.tar.gz gcc-3c4fa8a8562d3788bb763ca5c8fb1563b8d4eb1a.tar.bz2 |
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
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 54b9724..207d7c8 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -4979,7 +4979,7 @@ spread_undeadness (struct cgraph_node *node) callee = cs->callee->function_symbol (NULL); info = IPA_NODE_REF (callee); - if (info->node_dead) + if (info && info->node_dead) { info->node_dead = 0; spread_undeadness (callee); @@ -5017,18 +5017,19 @@ identify_dead_nodes (struct cgraph_node *node) struct cgraph_node *v; for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle) if (v->local + && IPA_NODE_REF (v) && !v->call_for_symbol_thunks_and_aliases (has_undead_caller_from_outside_scc_p, NULL, true)) IPA_NODE_REF (v)->node_dead = 1; 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); if (dump_file && (dump_flags & TDF_DETAILS)) { 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 ()); } } |