https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98404
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- You can always -fno-tree-loop-distribute-patterns. And as for -Os, especially in the earlier optimizations, GCC can't really know if a particular optimization will for a particular code result in larger or smaller code, it needs to use heuristics, which is tuned for improving code size in general, but can always misfire on some particular testcases. For inlining, GCC has -Os heuristics and estimation if function will grow or decrease overall size.