From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32326 invoked by alias); 29 Oct 2003 17:11:02 -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 32318 invoked by uid 48); 29 Oct 2003 17:11:01 -0000 Date: Wed, 29 Oct 2003 17:12:00 -0000 Message-ID: <20031029171101.32317.qmail@sources.redhat.com> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031029145012.12826.lee@bustech.com> References: <20031029145012.12826.lee@bustech.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/12826] Optimizer removes reference through volatile pointer X-Bugzilla-Reason: CC X-SW-Source: 2003-10/txt/msg02602.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12826 ------- Additional Comments From bangerth at dealii dot org 2003-10-29 17:10 ------- > But it does change the object's volatility to change the assignment of "*sp = > 0xE8" to "* (volatile char *) sp = 0xE8". No, it doesn't. The type of a variable is a static quantity and not changed by how you assign a value to it. You declared sp to be non-volatile, so it will always be non-volatile. > Gcc should at least be consistent > here, it seems... gcc is missing a chance to optimize. That's not a bug. > I'm not sure what you mean here, the char is what I want to be volatile, Then _declare_ it to be volatile! W.