https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80015
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2017-03-13 Version|unknown |7.0.1 Blocks| |53947 Summary|auto vectorization leaves |auto vectorization leaves |scalar code even if it is |scalar epilogue even if it |unreachable |is unreachable due to | |dominating n % 4 check Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- With __builtin_unreachable(); we early compute n as having low-order bits unset while with the return 0 this is obviously not true. Given we have no way to flow-sensitively attach that info to the other path the vectorizer isn't told about this. There is also no CCP pass after vectorization which eventually could recover from this. The two variants are not semantically equivalent btw. Confirmed. I think it should be viewed as a missing feature in niter analysis. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations