From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30161 invoked by alias); 18 Dec 2002 12:36:04 -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 30133 invoked by uid 71); 18 Dec 2002 12:36:03 -0000 Resent-Date: 18 Dec 2002 12:36:03 -0000 Resent-Message-ID: <20021218123603.30132.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, kevin@sylandro.com Received: (qmail 29313 invoked by uid 61); 18 Dec 2002 12:34:30 -0000 Message-Id: <20021218123430.29312.qmail@sources.redhat.com> Date: Wed, 18 Dec 2002 04:36:00 -0000 From: kevin@sylandro.com Reply-To: kevin@sylandro.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/8988: gcc3.2 and 3.2.1 with -O2 and -mcpu=i386 generates code that segfaults X-SW-Source: 2002-12/txt/msg00914.txt.bz2 List-Id: >Number: 8988 >Category: optimization >Synopsis: gcc3.2 and 3.2.1 with -O2 and -mcpu=i386 generates code that segfaults >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Wed Dec 18 04:36:02 PST 2002 >Closed-Date: >Last-Modified: >Originator: Kevin Easton >Release: gcc version 3.2.1 >Organization: >Environment: Reading specs from /home/kevin/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs Configured with: ./configure --prefix=/home/kevin Thread model: posix gcc version 3.2.1 >Description: When the attached correct code is compiled with gcc 3.2 or 3.2.1, with -mcpu=i386 (anything up to -mcpu=i586 will reproduce it), and -O2 optimisation level (both lower and higher optimisation levels do not produce the bug), it segfaults. The assembly code produced attempts to read from memory location 0x00000001. Even modifications as small as removing the function call that does nothing will stop the bug from happening. >How-To-Repeat: gcc -Wall -O2 -mcpu=i386 -g gcc-bug.c -o gcc-bug [kevin@indy cutdown]$ gdb ./gcc-bug ... Program received signal SIGSEGV, Segmentation fault. 0x0804835a in main (argc=1, argv=0xbffffad4) at gcc-bug.c:12 12 ptr++; >Fix: Compiling with -fno-strength-reduce -O2 fixes the problem, compiling with -O1 or lower fixes the problem, compiling with -O2 -mcpu=i686 or higher fixes the problem. The latest gcc 3.3 snapshot does not exhibit the problem. >Release-Note: >Audit-Trail: >Unformatted: