https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80652
--- Comment #2 from Peter Boyle <paboyle at ph dot ed.ac.uk> --- Thanks for the quick response. Hope this more complete info is helpful. Should give (1,0) but does give (0,0) under G++ 5.0-6.2 under -O3. peterboyle$ g++-mp-5 --version g++-mp-5 (MacPorts gcc5 5.4.0_0) 5.4.0 Under -O3: I THINK THIS IS WRONG AND A COMPILER ERROR c010200:~ peterboyle$ g++-mp-5 Gcc-test.cc -std=c++11 -O3 c010200:~ peterboyle$ ./a.out (0,0) c010200:~ peterboyle$ g++-mp-5 Gcc-test.cc -std=c++11 c010200:~ peterboyle$ ./a.out (1,0) Under g++4.9 c010200:~ peterboyle$ g++-4.9 Gcc-test.cc -std=c++11 -O3 c010200:~ peterboyle$ ./a.out (1,0) Under llvm xcode c010200:~ peterboyle$ g++ Gcc-test.cc -std=c++11 -O3 c010200:~ peterboyle$ ./a.out (1,0) I also used wandbox to to test many versions, and filed an issue on my own codebase where I first hit it (prior to small example reduction). Here is my issue report: https://github.com/paboyle/Grid/issues/100 https://wandbox.org/permlink/tzssJza6R9XnqANw https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80652 Getting Travis fails under gcc-5 for Test_simd, now that I added more comprehensive testing to the CI test suite. The limitations of Travis runtime limits & weak cores are being shown. Travis uses 5.4.1 for g++-5. We are going to move to a new CI server we bought for the purpose soon. Working (-) Broken (X): 4.9.0 - 4.9.1 - 5.1.0 X 5.2.0 X 5.3.0 X 5.4.0 X 6.1.0 X 6.2.0 X 6.3.0 - 7.1.0 - 8.0.0 (HEAD) - Clang 3.5 through 5.0 are good on this test. Options: a) Drop to -O2 under broken G++ versions b) Refuse to build with broken G++ versions. Opinions sought. Attempting to work around with #if (GNUC == 5 ) || ( ( GNUC == 6 ) && GNUC_MINOR < 3 ) #pragma GCC push_options #pragma GCC optimize ("O0") #endif and same to pop options around the SimdApply in Grid_vector_types. But, I now have very, very, VERY poor confidence in these compiler versions. e.g. Where else do we hit this? It is dangerous to not apply this globally (which we could force) but that will cripple performance. Do we unsupport a whole swathe of G++ versions? I posted on stack overflow to try to get a double check on the legality of the union use. http://stackoverflow.com/questions/2906365/gcc-strict-aliasing-and-casting-through-a-union/43820916#43820916 But, I think this is legal code.