https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114787
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- It is the if (dump_file && (dump_flags & TDF_DETAILS) && max_loop_iterations_int (loop) >= 0) { fprintf (dump_file, "Loop %d iterates at most %i times.\n", loop->num, (int)max_loop_iterations_int (loop)); } if (dump_file && (dump_flags & TDF_DETAILS) && likely_max_loop_iterations_int (loop) >= 0) { fprintf (dump_file, "Loop %d likely iterates at most %i times.\n", loop->num, (int)likely_max_loop_iterations_int (loop)); } cases which trigger the different code generation with -fdump-tree-profile_estimate-details -O1, either of them; guess max_loop_iterations_int and likely_max_loop_iterations_int cache the results and while it doesn't change the IL from the profile_estimate pass, it changes the behavior of the cunroll pass later on.