-
Notifications
You must be signed in to change notification settings - Fork 168
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
incorrect handling of [repr(packed)] and [repr(align(n)] struct attributes #3260
Comments
I wonder is the bool type throwing off our packed handling iirc I don't know if we have added the aligned support in or not will need to check |
philberty
added a commit
that referenced
this issue
Nov 26, 2024
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes #3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <[email protected]>
philberty
added a commit
that referenced
this issue
Nov 26, 2024
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes #3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <[email protected]>
philberty
added a commit
that referenced
this issue
Nov 27, 2024
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes #3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this issue
Nov 27, 2024
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes #3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <[email protected]>
tschwinge
pushed a commit
that referenced
this issue
Dec 4, 2024
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes #3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <[email protected]>
Kamiinarii78
pushed a commit
to Kamiinarii78/gccrs
that referenced
this issue
Dec 12, 2024
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes Rust-GCC#3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <[email protected]>
matthewjasper
pushed a commit
to matthewjasper/gccrs
that referenced
this issue
Dec 21, 2024
We cannot apply aligned or packed after layout_type is called you need to set this up first then call it. Fixes Rust-GCC#3260 gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): call lauout type directly * rust-backend.h (struct_type): add optional layout parameter (union_type): likewise (fill_in_fields): likewise * rust-gcc.cc (struct_type): likewise (union_type): likewise (fill_in_fields): only layout if we required Signed-off-by: Philip Herron <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Rust, the #[repr(packed)] attribute is intended to remove padding between struct fields. Similarly, #[repr(align(n))] is used to adjust the alignment of a struct to n bytes. However, in the case of gccrs, it appears that these attributes are not fully respected.
rustc:
gccrs:
godbolt: https://godbolt.org/z/rornPra3c
The text was updated successfully, but these errors were encountered: