[gnu.gcc.bug] gas bug in addressing mode

drh@PRINCETON.EDU (Dave Hanson) (05/12/89)

gas assembles the addressing mode @(X,dn:l:4) incorrectly,
e.g., in the 2 instructions at L2 below. Also shown below
are the results (shown by adb) of using as and gas.

orchard 69 cat bug.s
.globl _down
.comm _down,60
.globl _up
.comm _up,60
.text
.globl _main
_main:link a6,#-8
moveml #0x80,sp@(4)
L1:clrl d7
L2:movl #1,@(_down:l,d7:l:4)
movl #1,@(_up:l,d7:l:4)
L3:addql #1,d7
cmpl #15,d7; jlt L2
1:moveml sp@(4),#0x80
unlk a6
rts
orchard 70 cc bug.s
orchard 71 adb
main,5?ia
_main:
_main:			linkw	a6,#-8
_main+4:		moveml	d7,sp@(4)
_main+0xa:		clrl	d7
_main+0xc:		movl	#1,(0x20088:l,d7:l:4)
_main+0x18:		movl	#1,(0x200c8:l,d7:l:4)
_main+0x24:
:r
process	terminated
$q
orchard 72 gcc -v bug.s
gcc version 1.34
 /usr/local/gnu/lib/gcc-as -mc68020 bug.s -o bug.o
 ld -e start -dc -dp /lib/crt0.o /lib/Mcrt1.o bug.o /usr/local/gnu/lib/gcc-gnulib -lc
orchard 73 adb
main,5?ia
_main:
_main:			linkw	a6,#-8
_main+4:		moveml	d7,sp@(4)
_main+0xa:		clrl	d7
_main+0xc:		movl	#1,a0@(0,d7:l:4)
_main+0x14:		andb	#0xffffb800,d0
_main+0x18:
:r
SIGSEGV	11: segmentation violation
stopped	at	_main+0x14:		andb	#0xffffb800,d0
$q
orchard 74