-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible miscompilation on armv7 FreeBSD 14.1 #121299
Comments
@llvm/issue-subscribers-backend-arm Author: Robert Clausecker (clausecker)
Greetings,
While investigating a spurious test suite failure of the simdutf test suite, we found that the failure would only reproduce under specific circumstances:
The result of the miscompilation is that wrong code is generated, leading to unit test failure. A reduced example can be found in simdutf/simdutf#581 (comment). |
@dtcxzyw what information is needed to make this complete? |
@dtcxzyw Haven't tried clang on trunk yet, but I managed to reproduce this with clang 18.1.5 targeting armv7 on FreeBSD. |
Can you provide a single-file reproducer? A godbolt link would be better :) |
Oh sorry. I see that in the issue comment. |
The IR looks fine. I think the miscompilation lies immediately before the store bls std::__1::allocator<char16_t>>::operator[]
add r1, r0, r7
mov r2, r5
ldrh r8, [r1]
mov r1, #55296
strh r1, [r0, r7]!
bls std::__1::allocator<char16_t>>::operator[]
mov r1, r0
mov r2, #55296
strh r2, [r1, r7]! Culprit seems to be machine code sinking, MIR before machine-sink:
The buffer value is correctly loaded and saved before the
The original value has been overwritten by the time we load |
Greetings,
While investigating a spurious test suite failure of the simdutf test suite, we found that the failure would only reproduce under specific circumstances:
-fno-strict-aliasing
, code works fine with-fstrict-aliasing
The result of the miscompilation is that wrong code is generated, leading to unit test failure.
A reduced example can be found in simdutf/simdutf#581 (comment).
The text was updated successfully, but these errors were encountered: