[libc-commits] [libc] b152ea8 - [libc] Disable GCC 12 waccess passes to fix ICE in environ_internal (#197916)

via libc-commits libc-commits at lists.llvm.org
Fri May 15 05:24:07 PDT 2026


Author: Jeff Bailey
Date: 2026-05-15T12:24:01Z
New Revision: b152ea80bacb2a6538e91149badbc6c6d8a34491

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

LOG: [libc] Disable GCC 12 waccess passes to fix ICE in environ_internal (#197916)

The waccess pass in GCC 12 consistently segmentation faults when
analyzing the memory allocations in environ_internal.cpp. This change
disables the relevant tree-waccess passes for this specific file,
avoiding the ICE without requiring intrusive code refactoring.

Assisted-by: Automated tooling, human reviewed.

Added: 
    

Modified: 
    libc/src/stdlib/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/src/stdlib/CMakeLists.txt b/libc/src/stdlib/CMakeLists.txt
index e79353eb2a581..16c9874f01017 100644
--- a/libc/src/stdlib/CMakeLists.txt
+++ b/libc/src/stdlib/CMakeLists.txt
@@ -72,7 +72,9 @@ set(environ_internal_gcc12_workaround "")
 if((${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") AND
    (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12") AND
    (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13"))
-  set(environ_internal_gcc12_workaround "-Wno-stringop-overflow")
+  set(environ_internal_gcc12_workaround "-Wno-stringop-overflow"
+      "-fdisable-tree-waccess1" "-fdisable-tree-waccess2"
+      "-fdisable-tree-waccess3")
 endif()
 
 add_object_library(


        


More information about the libc-commits mailing list