🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2632

gas bug in addressing mode

#2632
From: Dave Hanson
Date: Fri, 12 May 1989 15:33
52 lines
1539 bytes
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 
Technical Details
Message-ID: <8905121533.AA08715@orchard.Princeton.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!PRINCETON.EDU!drh

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!PRINCETON.EDU!drh
From: drh@PRINCETON.EDU (Dave Hanson)
Newsgroups: gnu.gcc.bug
Subject: gas bug in addressing mode
Message-ID: <8905121533.AA08715@orchard.Princeton.EDU>
Date: 12 May 89 15:33:55 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 52