https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115825
--- Comment #17 from rguenther at suse dot de <rguenther at suse dot de> --- On Sat, 11 Jan 2025, segher at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115825 > > --- Comment #16 from Segher Boessenkool <segher at gcc dot gnu.org> --- > Trivial stuff is no longer unrolled at all after this change. It does not > matter > *at all* whether an insn has a side effect or not, for whether code with such > an > insn should be unrolled or not. Any heuristic like that is totally broken, > totally > nonsensical. There's limits on how much code growth we allow and we estimate the final code size, reducing that by 1/3 "optimistically" (followup transforms might optimize), the fix was to make that reduction not apply to statements that obviously never are valid to optimize. If you now no longer get "trivial" stuff unrolled then you run into the size limit. The previous code, assessing that 1/3rd of all insns with side-effects are going to be optimized away indeed made no sense.