aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-12-14 12:19:07 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-12-14 12:19:07 +0100
commit16570c12c91dc25beac2f96cf8b9d9b5ccd3cef3 (patch)
treef55691f6fe8eecfde229f1a2058529d442c1fe80
parent813b70a17b0cf8056b3005c3cdb882d522e02d84 (diff)
downloadgcc-16570c12c91dc25beac2f96cf8b9d9b5ccd3cef3.zip
gcc-16570c12c91dc25beac2f96cf8b9d9b5ccd3cef3.tar.gz
gcc-16570c12c91dc25beac2f96cf8b9d9b5ccd3cef3.tar.bz2
re PR ipa/92357 (ICE in IPA pass fnsummary in openmp offload)
PR ipa/92357 * ipa-fnsummary.c (ipa_fn_summary_write): Use lto_symtab_encoder_iterator with lsei_start_function_in_partition and lsei_next_function_in_partition instead of walking all cgraph nodes in encoder. From-SVN: r279395
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa-fnsummary.c18
2 files changed, 15 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e0ac204..a8d4a81 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2019-12-14 Jakub Jelinek <jakub@redhat.com>
+ PR ipa/92357
+ * ipa-fnsummary.c (ipa_fn_summary_write): Use
+ lto_symtab_encoder_iterator with lsei_start_function_in_partition and
+ lsei_next_function_in_partition instead of walking all cgraph nodes
+ in encoder.
+
PR tree-optimization/92930
* ipa-pure-const.c (special_builtin_state): Don't handle
BUILT_IN_APPLY. Formatting fixes.
diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
index a46b144..a54703f 100644
--- a/gcc/ipa-fnsummary.c
+++ b/gcc/ipa-fnsummary.c
@@ -4364,24 +4364,24 @@ static void
ipa_fn_summary_write (void)
{
struct output_block *ob = create_output_block (LTO_section_ipa_fn_summary);
+ lto_symtab_encoder_iterator lsei;
lto_symtab_encoder_t encoder = ob->decl_state->symtab_node_encoder;
unsigned int count = 0;
- int i;
- for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
+ for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
+ lsei_next_function_in_partition (&lsei))
{
- symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
- cgraph_node *cnode = dyn_cast <cgraph_node *> (snode);
- if (cnode && cnode->definition && !cnode->alias)
+ cgraph_node *cnode = lsei_cgraph_node (lsei);
+ if (cnode->definition && !cnode->alias)
count++;
}
streamer_write_uhwi (ob, count);
- for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
+ for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
+ lsei_next_function_in_partition (&lsei))
{
- symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
- cgraph_node *cnode = dyn_cast <cgraph_node *> (snode);
- if (cnode && cnode->definition && !cnode->alias)
+ cgraph_node *cnode = lsei_cgraph_node (lsei);
+ if (cnode->definition && !cnode->alias)
{
class ipa_fn_summary *info = ipa_fn_summaries->get (cnode);
class ipa_size_summary *size_info = ipa_size_summaries->get (cnode);