[Bug c++/92357] ICE in IPA pass fnsummary in openmp offload
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Dec 13 17:04:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92357
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Instead of the #c6 patch, perhaps we want:
--- gcc/ipa-fnsummary.c.jj 2019-12-05 14:02:20.559570378 +0100
+++ gcc/ipa-fnsummary.c 2019-12-13 18:01:08.344828332 +0100
@@ -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);
which follows what the other IPA function summary writer functions do?
Of course, this doesn't do anything about determine_versionability ICE.
More information about the Gcc-bugs
mailing list