https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66335
--- Comment #1 from vfdff <zhongyunde at huawei dot com> --- I suggest using the code following code similar to fix the issue. for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi)) { stmt = gsi_stmt (bsi); ... ... ... ... if (lim_data->cost >= LIM_EXPENSIVE) set_profitable_level (stmt); else continue; if (dump_file && (dump_flags & TDF_DETAILS)) { print_gimple_stmt (dump_file, stmt, 2, 0); fprintf (dump_file, " invariant up to level %d, cost %d.\n\n", loop_depth (lim_data->max_loop), lim_data->cost); } }