From 24699b4926072b07e3b4e01c865f1913e382f5ec Mon Sep 17 00:00:00 2001 From: makise-homura Date: Thu, 22 Aug 2024 21:24:31 +0300 Subject: [PATCH] Extend NVC workaround for no-optimize-sibling-calls __attribute__((optimize("no-optimize-sibling-calls"))) is not supported for at least some versions of NVC (nVidia HPC compiler), and this case has a workaround in gtest-port.h. Actually, this is true not just for NVC (that defines __NVCOMPILER), but for other EDG-based compilers as well, for example, LCC. So the correct check here would be not just for __NVCOMPILER, but for __EDG__ (NVC defines this too, because it is based on EDG). This commit does this. --- googletest/include/gtest/internal/gtest-port.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 8d27c2c4f..59ab39bfe 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -897,7 +897,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; // Ask the compiler not to perform tail call optimization inside // the marked function. #define GTEST_NO_TAIL_CALL_ __attribute__((disable_tail_calls)) -#elif defined(__GNUC__) && !defined(__NVCOMPILER) +#elif defined(__GNUC__) && !defined(__EDG__) #define GTEST_NO_TAIL_CALL_ \ __attribute__((optimize("no-optimize-sibling-calls"))) #else