From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26622 invoked by alias); 22 Jul 2013 10:07:22 -0000 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 Received: (qmail 26594 invoked by uid 89); 22 Jul 2013 10:07:21 -0000 X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO dub0-omc3-s32.dub0.hotmail.com) (157.55.2.41) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 22 Jul 2013 10:07:20 +0000 Received: from DUB124-W33 ([157.55.2.9]) by dub0-omc3-s32.dub0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 22 Jul 2013 03:07:12 -0700 X-TMN: [oSB9yfAYbFE8G1ZTF9F/oLlHsBbeGMjI] Message-ID: From: Bernd Edlinger To: Zoran Jovanovic , "gcc-patches@gcc.gnu.org" CC: Petar Jovanovic Subject: Re: [PATCH] Add a new option "-ftree-bitfield-merge" (patch / doc inside) Date: Mon, 22 Jul 2013 10:08:00 -0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00900.txt.bz2 Hello Zoran, I may be wrong, but what you are trying to do is very similar to what's in fold-const.c optimize_bit_field_compare(). There was a discussion in April 2012 on this thread: "Continue strict-volat= ile-bitfields fixes" http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01094.html The result was that this optimization seems to break other possible optimiz= ations later on, when -fstrict-volatile-bitfields was enabled on the SH target. Even when th= e bit fields are NOT volatile. (Of course you should not touch volatile bit fields at all) And this was added to optimize_bit_field_compare as a result: =A0 /* In the strict volatile bitfields case, doing code changes here may p= revent =A0=A0=A0=A0 other optimizations, in particular in a SLOW_BYTE_ACCESS setti= ng.=A0 */ =A0 if (flag_strict_volatile_bitfields> 0) =A0=A0=A0 return 0; Regards Bernd.=20=09=09=20=09=20=20=20=09=09=20=20