From b147078b30907629d6c120c91047a8ea2ffc6723 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Jan 2024 08:33:39 +0000 Subject: [PATCH] COMP: g++11: suppress optimisation. See #3024 --- src/OpenFOAM/primitives/Tensor/TensorI.H | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/OpenFOAM/primitives/Tensor/TensorI.H b/src/OpenFOAM/primitives/Tensor/TensorI.H index a2b47628e6..89352d73b2 100644 --- a/src/OpenFOAM/primitives/Tensor/TensorI.H +++ b/src/OpenFOAM/primitives/Tensor/TensorI.H @@ -538,6 +538,10 @@ inline Foam::Tensor Foam::Tensor::inv2D template +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Foam::Tensor Foam::Tensor::inner(const Tensor& t2) const { @@ -561,6 +565,10 @@ Foam::Tensor::inner(const Tensor& t2) const template +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Foam::Tensor Foam::Tensor::schur(const Tensor& t2) const { @@ -1103,6 +1111,10 @@ operator&(const Tensor& t1, const Tensor& t2) //- Inner-product of a SphericalTensor and a Tensor template +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor operator&(const SphericalTensor& st1, const Tensor& t2) { @@ -1117,6 +1129,10 @@ operator&(const SphericalTensor& st1, const Tensor& t2) //- Inner-product of a Tensor and a SphericalTensor template +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor operator&(const Tensor& t1, const SphericalTensor& st2) { @@ -1131,6 +1147,10 @@ operator&(const Tensor& t1, const SphericalTensor& st2) //- Inner-product of a SymmTensor and a Tensor template +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor operator&(const SymmTensor& st1, const Tensor& t2) { @@ -1153,6 +1173,10 @@ operator&(const SymmTensor& st1, const Tensor& t2) //- Inner-product of a Tensor and a SymmTensor template +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Tensor operator&(const Tensor& t1, const SymmTensor& st2) { @@ -1193,6 +1217,10 @@ operator&(const Tensor& t, const Vector& v) //- Inner-product of a Vector and a Tensor template +#if defined(__GNUC__) && !defined(__clang__) +// Workaround for gcc (11+) that fails to handle tensor dot vector +__attribute__((optimize("no-tree-vectorize"))) +#endif inline Vector operator&(const Vector& v, const Tensor& t) {