[llvm] 9400c64 - Revert "[cmake] Disable GCC lifetime DSE"

Sam James via llvm-commits llvm-commits at lists.llvm.org
Sat May 13 23:39:10 PDT 2023


Author: Sam James
Date: 2023-05-14T07:37:59+01:00
New Revision: 9400c64593b24cb61c264ef457e729d2bc372492

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

LOG: Revert "[cmake] Disable GCC lifetime DSE"

This reverts commit ce990b542617e5b52f69707b103a2424bec5e53b.

This breaks some build bots - specifically when using GCC to build LLVM and
then -fno-lifetime-dse ends up passed to Clang in some tests like at
https://lab.llvm.org/buildbot/#/builders/139/builds/40594.

Bug: https://github.com/llvm/llvm-project/issues/24952
Bug: https://github.com/llvm/llvm-project/issues/57740

Differential Revision: https://reviews.llvm.org/D150505

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 52cb2eaa3009a..578a3169178ee 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -594,16 +594,6 @@ if ( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
   add_flag_if_supported("-Werror=unguarded-availability-new" WERROR_UNGUARDED_AVAILABILITY_NEW)
 endif( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
 
-if ( LLVM_COMPILER_IS_GCC_COMPATIBLE )
-  # 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.
-  add_flag_if_supported("-fno-lifetime-dse" CMAKE_CXX_FLAGS)
-endif ( LLVM_COMPILER_IS_GCC_COMPATIBLE )
-
 # 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