https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86619
--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> --- On Mon, 23 Jul 2018, mickey.veksler at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86619 > > --- Comment #2 from Michael Veksler <mickey.veksler at gmail dot com> --- > >> type-based alias analysis doesn't distinguish between int[2] and int[3]. > > Is it just the way GCC implements type-based alias analysis, > or is it defined that way in the C and C++ standards? It's the way GCC implements it. > I suspect that the weaker alias analysis of arrays (int [size] and > std::array<int, size>) is one of the things that make C++ slower than > Fortran on some benchmarks. Not sure - Fortran shares the restriction and also uses pointer-based accesses. Fortran is just more constrained so it can put __restrict on its arrays as an implementation detail very aggressively.