Skip to content

Commit ba40d77

Browse files
damyanpCopilot
andauthored
Fix GCC 13 Release build test failures (microsoft#7364) (microsoft#8176)
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. Fixes microsoft#7364 --------- Co-authored-by: Copilot <[email protected]>
1 parent 90ae8d8 commit ba40d77

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

azure-pipelines.yml

Lines changed: 5 additions & 10 deletions
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:
@@ -99,13 +99,13 @@ stages:
9999
Linux_Gcc_Release:
100100
image: ${{ variables.linux }}
101101
configuration: Release
102-
CC: gcc-9
103-
CXX: g++-9
102+
CC: gcc
103+
CXX: g++
104104
Linux_Gcc_Debug:
105105
image: ${{ variables.linux }}
106106
configuration: Debug
107-
CC: gcc-9
108-
CXX: g++-9
107+
CC: gcc
108+
CXX: g++
109109
CMAKE_OPTS: -DLLVM_USE_SPLIT_DWARF=On
110110
MacOS_Clang_Release:
111111
image: ${{ variables.macOS }}
@@ -144,11 +144,6 @@ stages:
144144
displayName: 'Installing dependencies'
145145
condition: eq(variables['image'], variables['linux'])
146146
147-
- bash: |
148-
sudo apt-get install g++-9 -y
149-
displayName: 'Installing g++-9'
150-
condition: and(eq(variables['CXX'], 'g++-9'), eq(variables['image'], variables['linux']))
151-
152147
- bash: |
153148
brew update
154149
brew install ninja

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)