From mboxrd@z Thu Jan 1 00:00:00 1970 From: Latchesar Ionkov To: 9fans@cse.psu.edu Subject: Re: [9fans] 8a/8l bug Message-ID: <20031217192636.GA7069@ionkov.net> References: <20031217175958.GA6505@ionkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031217175958.GA6505@ionkov.net> User-Agent: Mutt/1.4.1i Date: Wed, 17 Dec 2003 14:26:36 -0500 Topicbox-Message-UUID: a846b5b8-eacc-11e9-9e20-41e7f4b1d025 Also ADDL $-1, AX is not equivalent to SUBL $1, AX The CF flag is different. Thanks, Lucho On Wed, Dec 17, 2003 at 12:59:58PM -0500, Latchesar Ionkov said: > Hi, > > I am working on making gcc to support the standard Plan9 object format. I > noticed something that IMO is a bug. > > If I try to compile: > > TEXT main(SB), $0 > ADDL $-1, AX > ADCL $-1, DX > RET > > the result from > > 8l -a t.8 > is: > > 001020 (1) TEXT main+0(SB),$0 > 001020 48 (2) SUBL $1, AX > 001021 83d2ff (3) ADCL $-1, DX > > According to my ia32 instruction set reference 0x48 is > DECL AX > > not > SUBL $1, AX > > Unlike SUBL, DECL doesn't change CF flag, so the ADCL instruction is not > working correctly. > > Where are these types of optimizations made? Is it possible to turn them off > completely? > > Thanks, > Lucho