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

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


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Jeff Bailey (kaladron)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/197916.diff


1 Files Affected:

- (modified) libc/src/stdlib/CMakeLists.txt (+3-1) 


``````````diff
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(

``````````

</details>


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


More information about the libc-commits mailing list