From 48182bd670dab4d0ced7f5f2d9fce6cb589dcfbb Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Fri, 3 Jan 2020 14:52:38 +0100 Subject: [PATCH] Avoid segfault when dumping IPA-CP lattices for unoptimized functions (PR 92917) 2020-01-03 Martin Jambor PR ipa/92917 * ipa-cp.c (print_all_lattices): Skip functions without info. From-SVN: r279859 --- gcc/ChangeLog | 5 +++++ gcc/ipa-cp.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8cbaa45d7b3..82c25d9b525 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2020-01-03 Martin Jambor + + PR ipa/92917 + * ipa-cp.c (print_all_lattices): Skip functions without info. + 2020-01-03 Jakub Jelinek PR target/93089 diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 43c0d5a6706..4381b35a809 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -543,8 +543,9 @@ print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits) class ipa_node_params *info; info = IPA_NODE_REF (node); - /* Skip constprop clones since we don't make lattices for them. */ - if (info->ipcp_orig_node) + /* Skip unoptimized functions and constprop clones since we don't make + lattices for them. */ + if (!info || info->ipcp_orig_node) continue; fprintf (f, " Node: %s:\n", node->dump_name ()); count = ipa_get_param_count (info); -- 2.30.2