jan@ISY.LIU.SE (Jan Danielsson) (10/19/89)
Program: gcc 1.36
Machine: sun3/280
OS: sunos4.0.3
Compiler configuration:
md -> ./config/m68k.md
tm.h -> ./config/tm-sun3.h
Problem:
The following c code produces an incorrect assembler instruction
in the output (the first line has been added by gcc-cpp):
# 1 "bugg.c"
int
p_version(doit)
char *doit;
{
long key = (long) 0x43174317;
if (doit != (0) || *((long *)0x7ffc) != key) {
*((long *)0x7ffc) = key;
}
return 0;
}
The assembler code produced
#NO_APP
gcc_compiled.:
.text
.even
.globl _p_version
_p_version:
link a6,#0
movel #1125597975,d0
tstl a6@(8)
jne L3
---> cmpl 32764:w:l,d0
jeq L2
L3:
movel d0,32764:w
L2:
moveq #0,d0
unlk a6
rts
The marked line containes the string ":w:l". I believe this is
incorrect.
The c code was compiled with
gcc -v -O -m68000 -S bugg.c
gcc -v -O -m68000 -c bugg.s
The compilation produces the following output
gcc -v -O -m68000 -S bugg.c
gcc version 1.36
/usr/local/lib/sun3/gcc-cpp -v -undef -D__GNUC__ -Dmc68000 \
-Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ \
-D__OPTIMIZE__ -D__HAVE_68881__ -Dmc68010 bugg.c \
/usr/tmp/cca15812.cpp
GNU CPP version 1.36
/usr/local/lib/sun3/gcc-cc1 /usr/tmp/cca15812.cpp -quiet \
-dumpbase bugg.c -m68000 -O -version -o bugg.s
GNU C version 1.36 (68k, MIT syntax) compiled by GNU C version 1.36.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
gcc -v -O -m68000 -c bugg.s
gcc version 1.36
as -mc68010 -o bugg.o bugg.s
as: error (bugg.s:11): Invalid operand
*** Error code 1
make: Fatal error: Command failed for target `buggtest.o'
---jan
Jan Danielsson
Dept. of Electrical Engineering jan@isy.liu.se(@uunet.uu.net)
University of Linkoping, Sweden ...!uunet!(enea|sunic)!isy.liu.se!jan