From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25814 invoked by alias); 16 May 2002 10:46:08 -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 25779 invoked by uid 71); 16 May 2002 10:46:02 -0000 Resent-Date: 16 May 2002 10:46:02 -0000 Resent-Message-ID: <20020516104602.25777.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, namsh@kldp.org Received:(qmail 24933 invoked from network); 16 May 2002 10:38:56 -0000 Received: from unknown (HELO namsh.wimo.co.kr) (61.79.94.186) by sources.redhat.com with SMTP; 16 May 2002 10:38:56 -0000 Received: (from namsh@localhost) by namsh.wimo.co.kr (8.11.6/8.11.6) id g4GActa05739; Thu, 16 May 2002 19:38:55 +0900 Message-Id:<200205161038.g4GActa05739@namsh.wimo.co.kr> Date: Thu, 16 May 2002 03:46:00 -0000 From: namsh@kldp.org To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: optimization/6673: gcc-3.1 produces wrong assembly code X-SW-Source: 2002-05/txt/msg00444.txt.bz2 List-Id: >Number: 6673 >Category: optimization >Synopsis: gcc-3.1 produces wrong assembly code >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Thu May 16 03:46:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Nam SungHyun >Release: 3.1 >Organization: >Environment: System: Linux namsh 2.4.19-pre8 #3 ±Ý 5¿ù 3 11:33:25 KST 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: powerpc-unknown-eabi configured with: ./configure --disable-nls --target=ppc-eabi --prefix=/usr/GNUPPC --with-gnu-ld --with-gnu-as --program-prefix=ppc-eabi- >Description: I build powerpc-unknown-eabi cross compiler using gcc CVS tree (cvs co -r gcc_3_1_release). input source (ex.c) is: ============================================================ unsigned long a; int main(void) { for (;;) ++a; } ============================================================ 'ppc-eabi-gcc -O1 -S ex.c' generates: ============================================================ .file "ex.c" .globl __eabi .section ".text" .align 2 .globl main .type main,@function main: stwu 1,-8(1) mflr 0 stw 0,12(1) bl __eabi .L2: b .L2 .Lfe1: .size main,.Lfe1-main .comm a,4,4 .ident "GCC: (GNU) 3.1" ============================================================ There's no asm code for '++a'. ppc-eabi-gcc 2.95.4 20010319 (prerelease) works as I expected. >How-To-Repeat: Always... preprocessor output is same as input source. so simple source >Fix: 1. use 'volatile' for 'a': volatile unsigned long a; 2. use '-O0' compile option >Release-Note: >Audit-Trail: >Unformatted: