Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!TRQ%ASTROPHYSICS.OXFORD.AC.UK From: TRQ%ASTROPHYSICS.OXFORD.AC.UK@MITVMA.MIT.EDU Newsgroups: gnu.gcc.bug Subject: (none) Message-ID: <9002021442.AA15888@life.ai.mit.edu> Date: 29 Jan 90 15:04:33 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 54 Subject: Bug in gcc v1.36 on Convex Gcc sometimes gets the wrong word when truncating "long long"s to "long". The following code demonstrates this. This is GCC version 1.36 running on a Convex-c1 running Convex UNIX version 7.0.1.23. Thomas Quinn MAIL: Dept. of Theoretical Physics, 1 Keble Road, Oxford, OX1 3RH, UK EMAIL: trq@astrophysics.oxford.ac.uk PHONE: 44-865-273956 The compile: gcc -v -g -O -S dbxread.c gcc version 1.36 /mnt/trquinn/lib/gcc-cpp -v -undef -D__GNUC__ -Dconvex -Dparsec -Dunix -D__convex__ -D__parsec__ -D__unix__ -D__OPTIMIZE__ dbxread.c /usr/tmp/cc000404.cpp GNU CPP version 1.36 /mnt/trquinn/lib/gcc-cc1 /usr/tmp/cc000404.cpp -quiet -dumpbase dbxread.c -g -O -version -o dbxread.s GNU C version 1.36 (convex) compiled by GNU C version 1.36. default target switches: -mc1 The bad assembly: .stabd 68,0,20 pshea 0 pshea @-8(fp) !! The convex is WORD_BIG_ENDIAN; this should !! be @-4(fp) pshea @-24(fp) mov sp,ap calls _lseek The code: struct filehdr $ unsigned long h_magic; unsigned long h_version; unsigned long long h_strptr; ; void symbol_file_command (name, from_tty) char *name; int from_tty; $ register int desc; struct filehdr filehdr; register int val; char *absolute_name; desc = openp (getenv ("PATH"), 1, name, 0 , 0, &absolute_name); if (myread (desc, &filehdr, sizeof filehdr) < 0) perror_with_name ( name); val = lseek (desc, ((long) filehdr.h_strptr) , 0);