From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13616 invoked by alias); 16 Apr 2003 17:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 13594 invoked by uid 71); 16 Apr 2003 17:16:01 -0000 Resent-Date: 16 Apr 2003 17:16:01 -0000 Resent-Message-ID: <20030416171601.13592.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, dberger@motorola.com Received: (qmail 8570 invoked by uid 48); 16 Apr 2003 17:07:29 -0000 Message-Id: <20030416170729.8569.qmail@sources.redhat.com> Date: Wed, 16 Apr 2003 17:16:00 -0000 From: dberger@motorola.com Reply-To: dberger@motorola.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/10423: -fvolatile switch not working in gcc 3.2-3 when using -O2 X-SW-Source: 2003-04/txt/msg00761.txt.bz2 List-Id: >Number: 10423 >Category: optimization >Synopsis: -fvolatile switch not working in gcc 3.2-3 when using -O2 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Apr 16 17:16:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: dberger@motorola.com >Release: 3.2-3 >Organization: >Environment: Cygwin and Solaris, native and cross compilers >Description: Compile with following using "gcc -O2 -fvolatile -S": void test(void) { *(char *)0x100 = 1; *(char *)0x100 = 1; *(char *)0x100 = 1; *(char *)0x100 = 1; } The definition of -fvolatile should cause four writes to be generated - always. With the 2.95 compiler that is what occurs. With the 3.2-3 compiler, only one remains after optimization. This is a serious problem for embedded, legacy programs. >How-To-Repeat: >Fix: Is there a workaround? >Release-Note: >Audit-Trail: >Unformatted: