From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5572 invoked by alias); 3 Sep 2010 18:35:03 -0000 Received: (qmail 5540 invoked by uid 22791); 3 Sep 2010 18:35:01 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Sep 2010 18:34:15 +0000 Received: (qmail 4489 invoked from network); 3 Sep 2010 18:34:13 -0000 Received: from unknown (HELO ?192.168.1.106?) (jie@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Sep 2010 18:34:13 -0000 Message-ID: <4C813F98.1010604@codesourcery.com> Date: Fri, 03 Sep 2010 18:41:00 -0000 From: Jie Zhang User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100821 Icedove/3.1.2 MIME-Version: 1.0 To: DJ Delorie CC: Mark Mitchell , gcc-patches@gcc.gnu.org, "Joseph S. Myers" , Daniel Jacobowitz , Paul Brook Subject: Re: patch: honor volatile bitfield types References: <201006152228.o5FMSbw6017351@greed.delorie.com> <4C17FF0A.4000602@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-09/txt/msg00289.txt.bz2 Hi DJ, On 06/17/2010 06:53 AM, DJ Delorie wrote: > Committed as attached. Whew. > > 2010-06-16 DJ Delorie > > * common.opt (-fstrict-volatile-bitfields): new. > * doc/invoke.texi: Document it. > * fold-const.c (optimize_bit_field_compare): For volatile > bitfields, use the field's type to determine the mode, not the > field's size. > * expr.c (expand_assignment): Likewise. > (get_inner_reference): Likewise. > (expand_expr_real_1): Likewise. > * expmed.c (store_fixed_bit_field): Likewise. > (extract_bit_field_1): Likewise. > (extract_fixed_bit_field): Likewise. > > 2010-06-16 DJ Delorie > > * gcc.target/i386/volatile-bitfields-1.c: New. > * gcc.target/i386/volatile-bitfields-2.c: New. > When I tried to make ARM EABI target default to -fstrict-volatile-bitfields, I found some regressions on ARM EABI caused by this flag: http://gcc.gnu.org/ml/gcc-patches/2010-09/msg00155.html h8300, sh and rx should also have the same regressions. m32c does not suffer it because it's not STRICT_ALIGNMENT. There are already some discussion under that thread. And with some more offline discussion with Joseph, Dan and Paul, we think this flag should be fixed to fix the regressions, i.e. when packed attribute conflicts with -fstrict-volatile-bitfields, GCC should honor packed attribute. One reason is that -fstrict-volatile-bitfields should not cause any regression on testsuite. Another reason is that this is what armcc does and we'd better keep compatibility with armcc on this case. BTW, it's a little confusing that -fstrict-volatile-bitfields causes a warning on code which does not use any bitfields. Regards, -- Jie Zhang CodeSourcery