-
Notifications
You must be signed in to change notification settings - Fork 13.3k
LLVM lint: Memory reference address is misaligned #28912
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
Comments
Seems to be caused by using the |
Oh, nevermind, I completely misread the problem here and confused it with a different issue. The alignment of the sizing type is fine and the right thing would indeed be to add the alignment info to the constant. |
Eh, I am confused. Isn't the alignment of |
We could probably extend that to allow for better packing of constants in some cases, but I'm not sure whether that's worth the trouble. |
For enum variants, the default alignment for a specific variant might be lower than the alignment of the enum type itself. In such cases we, for example, generate memcpy calls with an alignment that's higher than the alignment of the constant we copy from. To avoid that, we need to explicitly set the required alignment on constants. Fixes rust-lang#28912.
For enum variants, the default alignment for a specific variant might be lower than the alignment of the enum type itself. In such cases we, for example, generate memcpy calls with an alignment that's higher than the alignment of the constant we copy from. To avoid that, we need to explicitly set the required alignment on constants. Fixes #28912.
This is a subissue of #7463.
Compile with
rustc -C passes=lint
and you get:Manually setting alignment of const3020 to 8 in LLVM IR fixes the lint.
The text was updated successfully, but these errors were encountered: