From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2642 invoked by alias); 21 Sep 2011 08:22:00 -0000 Received: (qmail 2610 invoked by uid 22791); 21 Sep 2011 08:21:58 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Sep 2011 08:21:44 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R6I3q-0005EV-Eq for gcc@gcc.gnu.org; Wed, 21 Sep 2011 10:21:42 +0200 Received: from 193.128.72.68 ([193.128.72.68]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Sep 2011 10:21:42 +0200 Received: from paulo by 193.128.72.68 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Sep 2011 10:21:42 +0200 To: gcc@gcc.gnu.org From: "Paulo J. Matos" Subject: Re: Volatile qualification on pointer and data Date: Wed, 21 Sep 2011 08:22:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13 In-Reply-To: X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00205.txt.bz2 On 21/09/11 08:03, David Brown wrote: > Asking to read it by a volatile read does not > change the nature of "foo" - the compiler can still implement it as a > compile-time constant. But since I am accessing the data through the pointer and the pointer qualifies the data as volatile, shouldn't the compiler avoid this kind of optimization for reads through the pointer? It still is a regression from GCC45, however it might be considered a feature instead of a bug as I already mentioned to Ian. -- PMatos