- /* Fix profiling info. Scaling is done in gcov_type arithmetic to
- avoid losing information; this is slow, but is done at most
- once per loop. We special case 0 to avoid division by 0;
- probably other special cases exist. */
- total_count = body_count + entry_count;
- if (total_count == 0LL)
- {
- scale_bbs_frequencies_int (bbs, n_bbs, 0, 1);
- scale_bbs_frequencies_int (copied_bbs, n_bbs, 0, 1);
- }
- else
+ /* If the loop has the form "for (i = j; i < j + 10; i++)" then
+ this copying can introduce a case where we rely on undefined
+ signed overflow to eliminate the preheader condition, because
+ we assume that "j < j + 10" is true. We don't want to warn
+ about that case for -Wstrict-overflow, because in general we
+ don't warn about overflow involving loops. Prevent the
+ warning by setting the no_warning flag in the condition. */
+ if (warn_strict_overflow > 0)