This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
target/7371: code generation bug for mips-64
- From: Niels dot Nes at cwi dot nl
- To: gcc-gnats at gcc dot gnu dot org
- Date: Mon, 22 Jul 2002 14:21:15 +0200 (MET DST)
- Subject: target/7371: code generation bug for mips-64
- Reply-to: Niels dot Nes at cwi dot nl
>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 <stdio.h>
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: