https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91176
rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-07-15 Ever confirmed|0 |1 --- Comment #6 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #5) > I suppose it is previously latent problem that we do not skip debug > statements. Does something like this help? > > Index: ipa-fnsummary.c > =================================================================== > --- ipa-fnsummary.c (revision 273479) > +++ ipa-fnsummary.c (working copy) > @@ -2078,8 +2078,8 @@ analyze_function_body (struct cgraph_nod > > fix_builtin_expect_stmt = find_foldable_builtin_expect (bb); > > - for (gimple_stmt_iterator bsi = gsi_start_bb (bb); !gsi_end_p (bsi); > - gsi_next (&bsi)) > + for (gimple_stmt_iterator bsi = gsi_start_nondebug_bb (bb); > + !gsi_end_p (bsi); gsi_next_nondebug (&bsi)) > { > gimple *stmt = gsi_stmt (bsi); > int this_size = estimate_num_insns (stmt, &eni_size_weights); Yeah, I think that was it. I've just finished bootstrapping with an equivalent patch (continue if is_gimple_debug), but I'll try your version overnight. FWIW I don't think it was a latent bug though. Previously all we did with debug insns was estimate their size and speed, which are guaranteed to come back as zero and thus have no effect. The reason for the comparison failure is the new operand walk.