From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12453 invoked by alias); 18 Apr 2013 08:12:54 -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 12323 invoked by uid 48); 18 Apr 2013 08:12:51 -0000 From: "joey.ye at arm dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/56997] Incorrect write to packed field when strict-volatile-bitfields enabled on aarch32 Date: Thu, 18 Apr 2013 08:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joey.ye at arm dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg01664.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56997 --- Comment #1 from Joey Ye 2013-04-18 08:12:50 UTC --- Quoted from http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Code-Gen-Options.html#Code-Gen-Options: -fstrict-volatile-bitfields If the target requires strict alignment, and honoring the field type would require violating this alignment, a warning is issued. If the field has packed attribute, the access is done without honoring the field type. If the field doesn't have packed attribute, the access is done honoring the field type. In both cases, GCC assumes that the user knows something about the target hardware that it is unaware of. There are two issues in current behavior: 1. There is no warning when writing to packed fields requiring strict alignment. Although there is a warning when reading it. 2. The write access to packed field still honors the field type.