aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2019-11-29 14:29:35 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2019-11-29 14:29:35 +0100
commit68188fff88d0c302e6002a8b7450b17e4a26950b (patch)
treeb83ee676f2064ca521dc2c76ede5a06872fdd895 /gcc/ipa-cp.c
parent3edaed39583aeb49cfda7093ed4c0f9fed3fbea0 (diff)
downloadgcc-68188fff88d0c302e6002a8b7450b17e4a26950b.zip
gcc-68188fff88d0c302e6002a8b7450b17e4a26950b.tar.gz
gcc-68188fff88d0c302e6002a8b7450b17e4a26950b.tar.bz2
ipa-cp: Avoid ICEs when looking at expanded thunks and unoptimized functions
2019-11-29 Martin Jambor <mjambor@suse.cz> PR ipa/92476 * ipa-cp.c (set_single_call_flag): Set node_calling_single_call in the summary only if the summary exists. (find_more_scalar_values_for_callers_subset): Check node_dead in the summary only if the summary exists. (ipcp_store_bits_results): Ignore nodes without lattices. (ipcp_store_vr_results): Likewise. * cgraphclones.c: Include ipa-fnsummary.h and ipa-prop.h and the header files required by them. (cgraph_node::expand_all_artificial_thunks): Analyze expanded thunks. From-SVN: r278841
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index b133228..d0c6e91 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1165,7 +1165,7 @@ set_single_call_flag (cgraph_node *node, void *)
/* Local thunks can be handled transparently, skip them. */
while (cs && cs->caller->thunk.thunk_p && cs->caller->local)
cs = cs->next_caller;
- if (cs)
+ if (cs && IPA_NODE_REF (cs->caller))
{
IPA_NODE_REF (cs->caller)->node_calling_single_call = true;
return true;
@@ -4417,7 +4417,7 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node,
struct ipa_jump_func *jump_func;
tree t;
- if (IPA_NODE_REF (cs->caller)->node_dead)
+ if (IPA_NODE_REF (cs->caller) && IPA_NODE_REF (cs->caller)->node_dead)
continue;
if (!IPA_EDGE_REF (cs)
@@ -5422,6 +5422,9 @@ ipcp_store_bits_results (void)
if (info->ipcp_orig_node)
info = IPA_NODE_REF (info->ipcp_orig_node);
+ if (!info->lattices)
+ /* Newly expanded artificial thunks do not have lattices. */
+ continue;
unsigned count = ipa_get_param_count (info);
for (unsigned i = 0; i < count; i++)
@@ -5495,6 +5498,9 @@ ipcp_store_vr_results (void)
if (info->ipcp_orig_node)
info = IPA_NODE_REF (info->ipcp_orig_node);
+ if (!info->lattices)
+ /* Newly expanded artificial thunks do not have lattices. */
+ continue;
unsigned count = ipa_get_param_count (info);
for (unsigned i = 0; i < count; i++)