https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84362
Matthias Noack <ma.noack.pr at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ma.noack.pr at gmail dot com --- Comment #2 from Matthias Noack <ma.noack.pr at gmail dot com> --- As written on SO, replacing asm volatile("" : : "g"(&v) : "memory"); By return v.values[capacity - 1]; to avoid the loop being optimised away, leads to the same vectorised code in 7.x as well. So the missed vectorisation, or not inlining size() before vectorisation causing non-vectorisation due to: <source>:24:29: note: not vectorized: complicated access pattern. might be a side effect of the asm volatile() line.