You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Meeting proposal: When accessing a field that is at a "very aligned" offset, can the required alignment be higher than the type of the field indicates? #11
Sometimes when accessing a field, the alignment requirement is lower than the type of the field might indicate: specifically, this happens for fields of repr(packed) structs.
Can the alignment requirement ever be higher? For instance, in this type
#[repr(C)]structS{x:u8,y:u32}
the x field will always be at a 4-aligned address when occurring inside a well-aligned S instance. Therefore, Miri will make (*ptr).x UB if that load is not 4-aligned. This matches codegen which generates an align 4 load in this example.
Is that what we want, or should the alignment requirements of a field access in a struct always be upper-bounded by the alignment of that field?
These issues are meant to be used as an "announcements channel" regarding the proposal, and not as a
place to discuss the technical details. Feel free to subscribe to updates. We'll post comments when
reviewing the proposal in meetings or making a scheduling decision. In the meantime, if you have
questions or ideas, ping the proposers on Zulip (or elsewhere).