nvidia: work around GCC 16.1.x ICE compiling flcn_ls10.c#1235
Open
vs4848 wants to merge 3 commits into
Open
Conversation
GCC 16.1.x's instruction scheduler (sched2 RTL pass) segfaults with an internal compiler error while compiling _flcnDmemTransfer_LS10() in common/nvswitch/kernel/ls10/flcn_ls10.c at the default optimization level. This is a GCC codegen bug specific to this function's shape, not a defect in the source. Disable the two GCC instruction-scheduling passes (-fno-schedule-insns[2]) for this single translation unit only, gated to GCC >= 16.0.0 via the existing nv-compiler.sh version check. This unblocks builds on GCC 16 toolchains without disabling scheduling anywhere else in nv-kernel.o, and is a no-op on all other compilers/ versions. Fixes NVIDIA#1213
d8f9c26 to
32dddd1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1213
GCC 16.1.x's instruction scheduler (sched2 RTL pass) segfaults with an internal compiler error while compiling
_flcnDmemTransfer_LS10()incommon/nvswitch/kernel/ls10/flcn_ls10.cat the default optimization level. This is a GCC codegen bug specific to this function's shape, not a defect in the source.This disables the two GCC instruction-scheduling passes (
-fno-schedule-insns2 -fno-schedule-insns) for this single translation unit only, gated to GCC >= 16.0.0 via the existingnv-compiler.shversion check. This unblocks builds on GCC 16 toolchains without disabling scheduling anywhere else innv-kernel.o, and is a no-op on all other compilers/versions.Credit to @axiom0x0 for the original diagnosis and for manually verifying this workaround in #1213.
Verification: Built
common/nvswitch/kernel/ls10/flcn_ls10.cwith GCC 16 on Ubuntu 24.04 (via CI) — compiles cleanly with no ICE, build proceeds normally to subsequent files.