[llvm] e3ef26d - [llvm][CMake] Remove -fno-lifetime-dse (#173322)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 22 17:01:31 PST 2025


Author: Aiden Grossman
Date: 2025-12-22T17:01:27-08:00
New Revision: e3ef26df85c317665a2c505a0d9bc179fe67bdaf

URL: https://github.com/llvm/llvm-project/commit/e3ef26df85c317665a2c505a0d9bc179fe67bdaf
DIFF: https://github.com/llvm/llvm-project/commit/e3ef26df85c317665a2c505a0d9bc179fe67bdaf.diff

LOG: [llvm][CMake] Remove -fno-lifetime-dse (#173322)

Now that #24952 has been fixed by #170575, we no longer need to specify
-fno-lifetime-dse when building with gcc.

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 2d78626d953c9..182c4a7074a30 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -713,16 +713,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   append("-Werror=unguarded-availability-new" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 endif()
 
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND LLVM_ENABLE_LTO)
-  # LLVM data structures like llvm::User and llvm::MDNode rely on
-  # the value of object storage persisting beyond the lifetime of the
-  # object (#24952).  This is not standard compliant and causes a runtime
-  # crash if LLVM is built with GCC and LTO enabled (#57740).  Until
-  # these bugs are fixed, we need to disable dead store eliminations
-  # based on object lifetime.
-  append("-fno-lifetime-dse" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-endif ()
-
 # Modules enablement for GCC-compatible compilers:
 if ( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
   set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})


        


More information about the llvm-commits mailing list