From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4080 invoked by alias); 30 Apr 2015 10:08:07 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4051 invoked by uid 48); 30 Apr 2015 10:08:03 -0000 From: "npl at chello dot at" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65945] New: ARM: unaligned access when stroing nullptr Date: Thu, 30 Apr 2015 10:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.4 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: npl at chello dot at X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg02606.txt.bz2 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