https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59642
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 Status|UNCONFIRMED |NEW Last reconfirmed| |2017-04-04 Known to work| |4.7.3, 7.0.1 Target Milestone|--- |5.5 Summary|Performance regression |[5/6 Regression] |(4.7/4.8) with |Performance regression with |-ftree-loop-distribute-patt |-ftree-loop-distribute-patt |erns |erns Ever confirmed|0 |1 Known to fail| |5.4.0, 6.3.0 --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- We now unroll early enough to not regress compared to 4.8 anymore. Some niter analysis improvements make us unroll in cunrolli pass. Note that if you adjust the testcase to make sure we don't unroll code with loop distribution is better: void foo(int *v) { int *p; for(p = v; p < v + 18; ++p) *p = 0; for(p = v; p < v + 18; ++p) if(*p) *p = 1; } still we don't optimize the 2nd loop in GCC for the following testcase void foo(int *v, int n) { int *p; __builtin_memset (v, 0, n * sizeof (int)); for(p = v; p < v + n; ++p) if(*p) *p = 1; } because value-numbering isn't clever enough here (constant 'n' would be moderately easier to handle).