diff --git a/include/fmt/core.h b/include/fmt/core.h index 8e8d2f1c..897b52db 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -279,7 +279,7 @@ // Enable minimal optimizations for more compact code in debug mode. FMT_GCC_PRAGMA("GCC push_options") -#ifndef __OPTIMIZE__ +#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) FMT_GCC_PRAGMA("GCC optimize(\"Og\")") #endif diff --git a/include/fmt/format.h b/include/fmt/format.h index c4c9321d..f6a283ad 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -967,14 +967,17 @@ FMT_CONSTEXPR20 inline auto count_digits(uint64_t n) -> int { template FMT_CONSTEXPR auto count_digits(UInt n) -> int { #ifdef FMT_BUILTIN_CLZ - if (num_bits() == 32) + if (num_bits() == 32) { return (FMT_BUILTIN_CLZ(static_cast(n) | 1) ^ 31) / BITS + 1; + } else #endif - int num_digits = 0; - do { - ++num_digits; - } while ((n >>= BITS) != 0); - return num_digits; + { + int num_digits = 0; + do { + ++num_digits; + } while ((n >>= BITS) != 0); + return num_digits; + } } template <> auto count_digits<4>(detail::fallback_uintptr n) -> int;