Bug 2346439

Summary: DotNet9.0 fails to build with clang-20 on ppc64le
Product: [Fedora] Fedora Reporter: Tom Stellard <tstellar>
Component: clangAssignee: Tom Stellard <tstellar>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: airlied, bugproxy, fedora-llvm-team, jchecahi, kkleine, npopov, omajid+public, omajid, sergesanspaille, siddharth.kde, suraj.ghimire7, tbaeder, tstaudt, tstellar, tuliom
Target Milestone: ---Flags: tstellar: mirror+
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-03-21 23:13:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Stellard 2025-02-19 01:55:00 UTC
This was a regression from clang-19 to clang-20 introduced by this upstream PR: https://github.com/llvm/llvm-project/pull/111553 (More details in the PR comments).

I think we should consider reverting this patch in our clang-20 builds if it's not fixed upstream before the clang-20 upstream release.


Reproducible: Always

Comment 1 Omair Majid 2025-02-20 00:03:42 UTC
This is the same issue reported at https://github.com/dotnet/source-build/issues/4902, right?

Comment 2 Nikita Popov 2025-02-20 08:17:01 UTC
Yes, it's the same issue. Ideally this would be fixed *both* in LLVM and DotNot. LLVM should accept it, but at the same time this is clearly just a typo in the DotNot assembly (it's one use of %R3 in a long list of %r3's).

Comment 3 Tulio Magno Quites Machado Filho 2025-02-20 12:55:37 UTC
(In reply to Nikita Popov from comment #2)
> Ideally this would be fixed *both* in LLVM and DotNot.

Nikita, why is it ideal to change DotNet too?
This code is valid in other assemblers.
I have the impression the change of behavior was unintentional.

Comment 4 Nikita Popov 2025-02-20 13:17:23 UTC
> Nikita, why is it ideal to change DotNet too?

See https://github.com/dotnet/runtime/blob/da4f0a33ecec67908327138bfa0f153c3821fa78/src/coreclr/pal/src/arch/ppc64le/context2.S#L140.

There is one use of %R3 among ~150 uses of %r3. It's a typo, not an intentional style choice.

Comment 5 Tulio Magno Quites Machado Filho 2025-02-20 13:28:53 UTC
(In reply to Nikita Popov from comment #4)
> There is one use of %R3 among ~150 uses of %r3. It's a typo, not an
> intentional style choice.

It may break DotNet's coding style, but this is still valid code AFAIK.
Projects with a coding style where GPRs are higher case are also valid.
LLVM is missing a test to guarantee this regression won't happen again.

Comment 6 Tom Stellard 2025-03-17 20:29:33 UTC
This should be fixed now that clang-20 has landed in Fedora, so I think we can close this issue.