From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14541 invoked by alias); 22 Jul 2002 12:26:02 -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 14512 invoked by uid 71); 22 Jul 2002 12:26:01 -0000 Resent-Date: 22 Jul 2002 12:26:01 -0000 Resent-Message-ID: <20020722122601.14510.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, Niels.Nes@cwi.nl Received: (qmail 11518 invoked from network); 22 Jul 2002 12:21:16 -0000 Received: from unknown (HELO hera.cwi.nl) (192.16.191.8) by sources.redhat.com with SMTP; 22 Jul 2002 12:21:16 -0000 Received: from medusa.cwi.nl (medusa.cwi.nl [192.16.197.234]) by hera.cwi.nl with ESMTP id OAA24239 for ; Mon, 22 Jul 2002 14:21:15 +0200 (MEST) Received: (from niels@localhost) by medusa.cwi.nl (SGI-8.9.3/8.9.3) id OAA89583; Mon, 22 Jul 2002 14:21:15 +0200 (MET DST) Message-Id: <200207221221.OAA89583@medusa.cwi.nl> Date: Mon, 22 Jul 2002 05:26:00 -0000 From: Niels.Nes@cwi.nl Reply-To: Niels.Nes@cwi.nl To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: target/7371: code generation bug for mips-64 X-SW-Source: 2002-07/txt/msg00599.txt.bz2 List-Id: >Number: 7371 >Category: target >Synopsis: Negative offsets const arrays result in Sig BUS >Confidential: no >Severity: serious >Priority: low >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Mon Jul 22 05:26:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Niels Nes >Release: 3.1 >Organization: CWI >Environment: System: IRIX64 medusa 6.5 10100655 IP27 host: mips-sgi-irix6.5 build: mips-sgi-irix6.5 target: mips-sgi-irix6.5 configured with: ../configure --prefix=/soft/gcc-3.1 >Description: The following small example gives a SIG BUS when compiled with -mabi=64. Only happens with const arrays and a const offset. In the assembly code a line .dword a-16 combining the two can be found (possibly a problem on a mips (I'm not sure)). #include static const int a [] = { 0, 1, 4, 6, }; main(){ int i = 0; for(i=4;i<8;i++){ printf( "%d %d\n", i, a [i - 4] ); } } >How-To-Repeat: >Fix: Work around: remove the keyword const. >Release-Note: >Audit-Trail: >Unformatted: