[libc-commits] [libc] [libc] Make FPUtils' rounding_mode.h functions constexpr. (PR #149167)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Wed Jul 23 08:03:43 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime-2` running on `rocm-worker-hw-02` while building `libc` at step 5 "compile-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/10025

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (compile-openmp) failure: build (failure)
...
6.277 [858/24/3815] Building CXX object lib/Target/X86/AsmParser/CMakeFiles/LLVMX86AsmParser.dir/X86AsmParser.cpp.o
6.285 [858/23/3816] Building CXX object tools/llvm-exegesis/lib/X86/CMakeFiles/obj.LLVMExegesisX86.dir/Target.cpp.o
6.303 [858/22/3817] Linking CXX shared library lib/libLLVMX86Info.so.22.0git
6.306 [857/22/3818] Building CXX object tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/HIPUtility.cpp.o
6.312 [857/21/3819] Creating library symlink lib/libLLVMX86Info.so
6.369 [855/22/3820] Linking CXX shared library lib/libLLVMX86Disassembler.so.22.0git
6.378 [854/22/3821] Creating library symlink lib/libLLVMX86Disassembler.so
6.409 [854/21/3822] Linking CXX shared library lib/libLLVMX86Desc.so.22.0git
6.418 [853/21/3823] Creating library symlink lib/libLLVMX86Desc.so
7.124 [853/20/3824] Building CXX object tools/llvm-gpu-loader/CMakeFiles/llvm-gpu-loader.dir/amdhsa.cpp.o
FAILED: tools/llvm-gpu-loader/CMakeFiles/llvm-gpu-loader.dir/amdhsa.cpp.o 
ccache /usr/bin/c++ -DAMDHSA_SUPPORT -DEXPERIMENTAL_KEY_INSTRUCTIONS -DGTEST_HAS_RTTI=0 -DLIBC_NAMESPACE=__llvm_libc_common_utils -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/llvm-gpu-loader -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/tools/llvm-gpu-loader -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/include -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/include -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc -isystem /opt/rocm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/llvm-gpu-loader/CMakeFiles/llvm-gpu-loader.dir/amdhsa.cpp.o -MF tools/llvm-gpu-loader/CMakeFiles/llvm-gpu-loader.dir/amdhsa.cpp.o.d -o tools/llvm-gpu-loader/CMakeFiles/llvm-gpu-loader.dir/amdhsa.cpp.o -c /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/tools/llvm-gpu-loader/amdhsa.cpp
In file included from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/stdio/printf_core/int_converter.h:19,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/stdio/printf_core/strerror_converter.h:15,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/stdio/printf_core/converter.h:15,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/RPC/rpc_server.h:43,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/shared/rpc_server.h:13,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/tools/llvm-gpu-loader/server.h:19,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/tools/llvm-gpu-loader/amdhsa.cpp:17:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/stdio/printf_core/writer.h:55:30: warning: ‘maybe_unused’ attribute ignored [-Wattributes]
   55 |   [[maybe_unused]] WriteMode write_mode_;
      |                              ^~~~~~~~~~~
In file included from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/stdio/printf_core/float_dec_converter.h:14,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/stdio/printf_core/converter_atlas.h:32,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/stdio/printf_core/converter.h:21,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/RPC/rpc_server.h:43,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/shared/rpc_server.h:13,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/tools/llvm-gpu-loader/server.h:19,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/tools/llvm-gpu-loader/amdhsa.cpp:17:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h: In function ‘constexpr bool __llvm_libc_common_utils::fputil::fenv_is_round_up()’:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h:29:20: error: lvalue-to-rvalue conversion of a volatile lvalue ‘x’ with type ‘volatile float’
   29 |     return (1.0f + x != 1.0f);
      |                    ^
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h: In function ‘constexpr bool __llvm_libc_common_utils::fputil::fenv_is_round_down()’:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h:42:21: error: lvalue-to-rvalue conversion of a volatile lvalue ‘x’ with type ‘volatile float’
   42 |     return (-1.0f - x != -1.0f);
      |                     ^
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h: In function ‘constexpr bool __llvm_libc_common_utils::fputil::fenv_is_round_to_nearest()’:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h:57:22: error: lvalue-to-rvalue conversion of a volatile lvalue ‘x’ with type ‘volatile float’
   57 |     float y = 1.5f + x;
      |                      ^
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h: In function ‘constexpr bool __llvm_libc_common_utils::fputil::fenv_is_round_to_zero()’:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h:77:40: error: lvalue-to-rvalue conversion of a volatile lvalue ‘x’ with type ‘volatile float’
   77 |     volatile float y = 0x1.000002p0f + x;
      |                                        ^
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h: In function ‘constexpr int __llvm_libc_common_utils::fputil::quick_get_round()’:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/cmake/Modules/../../libc/src/__support/FPUtil/rounding_mode.h:88:40: error: lvalue-to-rvalue conversion of a volatile lvalue ‘x’ with type ‘volatile float’
   88 |     volatile float y = 0x1.000002p0f + x;
      |                                        ^

```

</details>

https://github.com/llvm/llvm-project/pull/149167


More information about the libc-commits mailing list