https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119479
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- In particular, changing static inline constexpr T det(const storage<T, 3>& a, const storage<T, 3>& b, const storage<T, 3>& c) { static std::array<size_t, 3> i = { 0, 1, 2 }; static std::array<size_t, 3> j = { 2, 1, 0 }; return storage<T,3>::dot_sse(a.pinr(i), b.pinr(i), c.pinr(i)) - storage<T,3>::dot_sse(a.pinr(j), b.pinr(j), c.pinr(j)); } to static inline constexpr T det(const storage<T, 3>& a, const storage<T, 3>& b, const storage<T, 3>& c) { static std::array<size_t, 3> i = { 0, 1, 2 }; static std::array<size_t, 3> j = { 2, 1, 0 }; auto a1 = a.pinr(i), b1 = b.pinr(i), c1 = c.pinr(i); auto a2 = a.pinr(j), b2 = b.pinr(j), c2 = c.pinr(j); return storage<T,3>::dot_sse(a1, b1, c1) - storage<T,3>::dot_sse(a2, b2, c2); } makes it well defined and consistent -717 result from both compilers and auto c1 = c.pinr(i), b1 = b.pinr(i), a1 = a.pinr(i); auto c2 = c.pinr(j), b2 = b.pinr(j), a2 = a.pinr(j); consistent 717 result.