https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65945
Bug ID: 65945 Summary: ARM: unaligned access when stroing nullptr Product: gcc Version: 4.8.4 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: npl at chello dot at Target Milestone: --- Created attachment 35429 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35429&action=edit code causing the issue Hello, the attachedcode produces an unaligned access for arm, on the production code I ran into this issue with versions 5.1, 4.9.2, 4.8.4. This reduced testcase doesnt produce the issue with 5.1, but for 4.9.2 and 4.8.4. The issue seems to be the line constexpr inline_type bool operator ==(bitmask X, decltype(nullptr)) \ { return X == bitmask(); } aparrently gcc converts stores the given parameter on the frame without caring for alignment ("str r3, [fp, #-25]"). changing the type to unsigned seems to fix this Commandline to reproduce: arm-none-eabi-g++ -std=c++11 -O0 -c unalignedgcc.cpp