Skip to content

Comments

Fix GCC 13 Release build test failures (#7364)#8176

Open
damyanp wants to merge 2 commits intomicrosoft:mainfrom
damyanp:gcc-13
Open

Fix GCC 13 Release build test failures (#7364)#8176
damyanp wants to merge 2 commits intomicrosoft:mainfrom
damyanp:gcc-13

Conversation

@damyanp
Copy link
Member

@damyanp damyanp commented Feb 19, 2026

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.

Fixes #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 <223556219+Copilot@users.noreply.github.com>
@damyanp
Copy link
Member Author

damyanp commented Feb 19, 2026

DXC doesn't build correctly with gcc-14 - -fno-tree-vrp avoids that particular failure, but since there doesn't seem to a bug filed against gcc for that the assumption here is that this is running afoul of some UB that we should address. This change at least lets us move to a more recent compiler.

It looks like this reproduces the gcc-14.2 bug:

https://godbolt.org/z/b1MsjMoqq

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>
@damyanp damyanp marked this pull request as ready for review February 20, 2026 01:58
@tex3d
Copy link
Contributor

tex3d commented Feb 20, 2026

DXC doesn't build correctly with gcc-14 - -fno-tree-vrp avoids that particular failure, ...

Given this, should gcc-13 be chosen explicitly, or -fno-tree-vrp added if using gcc-14? Or will gcc-14 never become the default gcc on Ubuntu-24.04?

@damyanp
Copy link
Member Author

damyanp commented Feb 20, 2026

DXC doesn't build correctly with gcc-14 - -fno-tree-vrp avoids that particular failure, ...

Given this, should gcc-13 be chosen explicitly, or -fno-tree-vrp added if using gcc-14?

Assuming that it really is this issue (I've not been able to find a bug report that convincingly looks like it covers it) then the bug is present in 14.2 but not in 14.3. I'd rather cross this bridge when/if we come to it than pre-emptively disable optimizations that might be masking UB in our code.

Or will gcc-14 never become the default gcc on Ubuntu-24.04?

I think that this might actually be the case as well. Ubuntu-latest was another option that I avoided because I didn't want major upgrades happening without our involvement.

Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Test failures when building with GCC-13+

2 participants