From c844d0b677f9346db53730aceca272bf2b02df3c Mon Sep 17 00:00:00 2001 From: Damyan Pepper Date: Thu, 19 Feb 2026 17:40:29 +0000 Subject: [PATCH 1/2] Fix GCC 13 Release build test failures (#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 #7365. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- azure-pipelines.yml | 2 +- cmake/modules/HandleLLVMOptions.cmake | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5b0c5d3791..12174fe6e1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,7 +78,7 @@ stages: variables: macOS: macOS-latest - linux: Ubuntu-22.04 # FIXME: #7364, DXC does not build correctly with GCC 13+ + linux: Ubuntu-24.04 strategy: matrix: diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index f838acccf5..d5769abce7 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -16,6 +16,14 @@ if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) message(FATAL_ERROR "Host GCC version must be at least 4.7!") endif() + # GCC 13 has a known miscompilation bug in -funswitch-loops + # (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109934) that causes + # widespread test failures at -O3. Disable -funswitch-loops for GCC 13. + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0 AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0) + add_compile_options(-fno-unswitch-loops) + message(STATUS "Disabling -funswitch-loops due to GCC 13 miscompilation bug (PR109934)") + endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1) message(FATAL_ERROR "Host Clang version must be at least 3.1!") From 4a8caffb44dfc9c76f78ff777ae827f9a3e87d64 Mon Sep 17 00:00:00 2001 From: Damyan Pepper Date: Thu, 19 Feb 2026 14:29:58 -0800 Subject: [PATCH 2/2] Use default GCC from build image instead of gcc-9 Remove explicit gcc version suffix from Linux_Gcc_Release and Linux_Gcc_Debug builds, and remove the apt-get install step for g++. This lets the builds use whichever GCC ships with the build image. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- azure-pipelines.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 12174fe6e1..c4f7195066 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -99,13 +99,13 @@ stages: Linux_Gcc_Release: image: ${{ variables.linux }} configuration: Release - CC: gcc-9 - CXX: g++-9 + CC: gcc + CXX: g++ Linux_Gcc_Debug: image: ${{ variables.linux }} configuration: Debug - CC: gcc-9 - CXX: g++-9 + CC: gcc + CXX: g++ CMAKE_OPTS: -DLLVM_USE_SPLIT_DWARF=On MacOS_Clang_Release: image: ${{ variables.macOS }} @@ -144,11 +144,6 @@ stages: displayName: 'Installing dependencies' condition: eq(variables['image'], variables['linux']) - - bash: | - sudo apt-get install g++-9 -y - displayName: 'Installing g++-9' - condition: and(eq(variables['CXX'], 'g++-9'), eq(variables['image'], variables['linux'])) - - bash: | brew update brew install ninja