-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Overly optimized simultaneous copy of struct fields corrupts destination struct #49967
Comments
assigned to @rotateright |
https://reviews.llvm.org/D86420 ? Slightly more clear testcase: struct S { char val1; char padding; short val2; }; |
Yes...ouch. That patch allowed matching multiple types, but I failed to make sure that the types match each other and/or map all of the stored bytes. Working on a fix now. |
Should be fixed after: Leaving status as open as a candidate for the 12.0.1 release. |
*** Bug llvm/llvm-bugzilla-archive#50635 has been marked as a duplicate of this bug. *** |
Merged: b54ccef |
Thanks for the quick response time! |
mentioned in issue llvm/llvm-bugzilla-archive#50635 |
Extended Description
Clang 12.0.0 modifies a field of a struct that should not be modified. This is a regression from clang 11.0.1.
Input File:
Output from clang 12.0.0 (clang -c test.c -o test.o -O1 && objdump -S test.o -M intel):
Output from clang 11.0.1:
The output from clang 12.0.0 is incorrect because it modifies the field
dest->padding
.See also here: https://godbolt.org/z/dsr9soqbf
"armv8-a clang (trunk)" exhibits the same problem.
The text was updated successfully, but these errors were encountered: