public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65945] New: ARM: unaligned access when stroing nullptr
@ 2015-04-30 10:08 npl at chello dot at
  2015-04-30 10:09 ` [Bug c++/65945] " npl at chello dot at
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: npl at chello dot at @ 2015-04-30 10:08 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-07-10 11:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 10:08 [Bug c++/65945] New: ARM: unaligned access when stroing nullptr npl at chello dot at
2015-04-30 10:09 ` [Bug c++/65945] " npl at chello dot at
2015-04-30 10:13 ` npl at chello dot at
2015-04-30 11:29 ` [Bug c++/65945] C++ alignment of nullptr_t is 1 and might cause unaligned stores to the frame redi at gcc dot gnu.org
2015-04-30 13:47 ` npl at chello dot at
2015-04-30 13:57 ` npl at chello dot at
2015-04-30 14:30 ` pinskia at gcc dot gnu.org
2015-04-30 20:27 ` npl at chello dot at
2015-05-22 18:20 ` foom at fuhm dot net
2015-05-25 13:23 ` ebotcazou at gcc dot gnu.org
2015-06-04 21:32 ` foom at fuhm dot net
2015-06-19 14:08 ` foom at fuhm dot net
2015-07-01 17:07 ` jason at gcc dot gnu.org
2015-07-01 17:59 ` jason at gcc dot gnu.org
2015-07-01 18:01 ` jason at gcc dot gnu.org
2015-07-01 18:07 ` jason at gcc dot gnu.org
2015-07-10 11:08 ` npl at chello dot at

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).