Skip to content

Commit c844d0b

Browse files
damyanpCopilot
andcommitted
Fix GCC 13 Release build test failures (microsoft#7364)
GCC 13 (e.g. 13.3.0 shipped with Ubuntu 24.04) has a known miscompilation bug in -funswitch-loops (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109934) that causes widespread test failures when building DXC at -O3. Disable -funswitch-loops for GCC 13, and update the CI pipeline from Ubuntu-22.04 to Ubuntu-24.04 (which ships GCC 13 as default), removing the workaround from microsoft#7365. Co-authored-by: Copilot <[email protected]>
1 parent de4f235 commit c844d0b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ stages:
7878

7979
variables:
8080
macOS: macOS-latest
81-
linux: Ubuntu-22.04 # FIXME: #7364, DXC does not build correctly with GCC 13+
81+
linux: Ubuntu-24.04
8282

8383
strategy:
8484
matrix:

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
1616
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
1717
message(FATAL_ERROR "Host GCC version must be at least 4.7!")
1818
endif()
19+
# GCC 13 has a known miscompilation bug in -funswitch-loops
20+
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109934) that causes
21+
# widespread test failures at -O3. Disable -funswitch-loops for GCC 13.
22+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0 AND
23+
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0)
24+
add_compile_options(-fno-unswitch-loops)
25+
message(STATUS "Disabling -funswitch-loops due to GCC 13 miscompilation bug (PR109934)")
26+
endif()
1927
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
2028
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
2129
message(FATAL_ERROR "Host Clang version must be at least 3.1!")

0 commit comments

Comments
 (0)