From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25269 invoked by alias); 3 Jul 2005 05:11:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25257 invoked by uid 22791); 3 Jul 2005 05:11:06 -0000 Received: from smtp-100-sunday.noc.nerim.net (HELO mallaury.nerim.net) (62.4.17.100) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 03 Jul 2005 05:11:06 +0000 Received: from uniton.integrable-solutions.net (gdr.net1.nerim.net [62.212.99.186]) by mallaury.nerim.net (Postfix) with ESMTP id 0CD944F3B1; Sun, 3 Jul 2005 07:11:01 +0200 (CEST) Received: from uniton.integrable-solutions.net (localhost [127.0.0.1]) by uniton.integrable-solutions.net (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j635A7KY027650; Sun, 3 Jul 2005 07:10:07 +0200 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.10/8.12.10/Submit) id j635A7TN027649; Sun, 3 Jul 2005 07:10:07 +0200 To: gcc-bugzilla@gcc.gnu.org Cc: gcc-bugs@gcc.gnu.org Subject: Re: [Bug c/22278] gcc -O2 discards cast to volatile References: <20050702164323.22278.olivier.baudron@m4x.org> <20050703044329.10129.qmail@sourceware.org> From: Gabriel Dos Reis In-Reply-To: <20050703044329.10129.qmail@sourceware.org> Date: Sun, 03 Jul 2005 05:11:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-07/txt/msg00248.txt.bz2 List-Id: "gdr at integrable-solutions dot net" writes: | | Still, consider the following variant: | | | | void quux(int *bar) { | | *(volatile int*)bar = 42; | | } | | | | volatile int foo; | | quux((int*)&foo); | | | | This time there is no "attempt [...] to refer to an object defined with a | | volatile-qualified type through use of an lvalue with non-volatile-qualified | | type". | | | Really? that comment is wrong, sorry. You're right. (time for me to go to bed). Yes, this is a bug in GCC. -- Gaby