Path: utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!shelby!neon!neon.Stanford.EDU!ham From: ham@Neon.Stanford.EDU (Peter R. Ham) Newsgroups: gnu.gcc.bug Subject: gcc-1.36 DecStation 3100 bug (breaks g++, too) Message-ID: Date: 15 Dec 89 00:22:29 GMT Sender: USENET News System Distribution: gnu Organization: Stanford University Lines: 44 On the DecStation, immediate constants are limited to 16 bits where the highest bit is sign extended. gcc generates some immediate constants that are too large. Unfortunately, a bug in the mips as doesn't generate an error, but instead treats large positive constants as negative ones. Enclosed is a test case, sample run, and resulting assembly. main() { char* s[0xfffff]; } 32 Huey.Stanford.EDU> gcc -v -S -O big.c gcc version 1.36 /usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dmips -Dunix -Dultrix -D__mips__ -D__unix__ -D__ultrix__ -D__OPTIMIZE__ -DR3000 -DLANGUAGE_C -DMIPSEL -DSYSTYPE_BSD big.c /usr/tmp/cca00609.cpp GNU CPP version 1.36 /usr/local/lib/gcc-cc1 /usr/tmp/cca00609.cpp -O -fstrength-reduce -fomit-frame-pointer -quiet -dumpbase big.c -O -version -o big.s GNU C version 1.36 (MIPS 1.10) compiled by GNU C version 1.36. default target switches: -munix -mnofixed-ovfl -mG0 -mG1 # .verstamp 2 0 gcc_compiled.: .text .align 2 .globl main .ent main main: subu $29,4194312 # saveregs= 8 .frame $30,0,$31 .mask 0x40000000,-4194308 sw $30,4($29) addiu $30,$29,4194312 # define fp addu $8,$0,$30 # don't trust sp? lw $30,-4194308($8) addu $29,$0,$8 # sp not trusted here j $31 .end main -- Peter Ham PO Box 3430 (h)(415) 322-4390 MS Computer Science Student Stanford, CA ham@cs.stanford.edu Stanford University 94309 (o)(415) 723-2067