This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65945] New: ARM: unaligned access when stroing nullptr
- From: "npl at chello dot at" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Apr 2015 10:08:02 +0000
- Subject: [Bug c++/65945] New: ARM: unaligned access when stroing nullptr
- Auto-submitted: auto-generated
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