https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87373
Bug ID: 87373 Summary: Packed structs are not handled properly on ARM architecture even with misaligned access is enabled Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: murat.ursavas at gmail dot com Target Milestone: --- Created attachment 44731 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44731&action=edit Minimum Test Case Hi, I've faced a weird behavior on my ARM MCU about a year ago and reported it on the launchpad page. In the meantime I tried to report the issue at here but your register process is longer than expected and here I'm reporting this issue almost a year later. We'd discussed the issue on this page: https://bugs.launchpad.net/gcc-arm-embedded/+bug/1738730 I think this looks like a bug, but with my limited internal GCC knowledge, I don't want to be rude and call it like that directly. If I should summarize the discussion; The GCC versions from 5.2 to 7, the compiler generates unexpected code while handling packed structs. Normally the behavior should be like 4.9 but somehow it got broken since then. Misaligned access should help but this does not seem to be the case. I've attached a minimum example which reproduces the issue. About the seriousness; I can not update my compiler and still use 4.9 for our products. This is a annoying drawback for me because I know GCC has received many improvements since then. The IDE which I use is still deployed with 4.9 and this is unacceptable from my point of view. MCU Core: ARM Cortex M3