9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Latchesar Ionkov <lucho@ionkov.net>
To: 9fans@cse.psu.edu
Subject: [9fans] 8a/8l bug
Date: Wed, 17 Dec 2003 12:59:58 -0500	[thread overview]
Message-ID: <20031217175958.GA6505@ionkov.net> (raw)

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



             reply	other threads:[~2003-12-17 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-17 17:59 Latchesar Ionkov [this message]
2003-12-17 19:26 ` Latchesar Ionkov
2003-12-17 22:54   ` Russ Cox
2003-12-17 23:33     ` Latchesar Ionkov
2003-12-17 23:38       ` Russ Cox
2003-12-18  0:13         ` Latchesar Ionkov
2003-12-18  0:25         ` Charles Forsyth
2003-12-18  4:54   ` jmk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031217175958.GA6505@ionkov.net \
    --to=lucho@ionkov.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).