public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* Bug of gas (binutils-2.9.1.0.23): Wrong code for SETHI on SPARC
@ 1999-04-02  8:04 Andreas Borchert
  1999-04-02 11:49 ` H.J. Lu
  1999-04-02 16:10 ` H.J. Lu
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Borchert @ 1999-04-02  8:04 UTC (permalink / raw)
  To: hjl

Dear H.J. Lu,

gas out of binutils-2.9.1.0.23 (and older versions) has a severe bug
for the SPARC platform (sparc-sun-solaris2.6), i.e. it generates
wrong code for

        sethi   0x4000,%i0

(and probably in all other cases where sethi is used without the
%hi(...)-construct).

The sethi instruction has following suggested assembly syntax
(see SPARC Architecture Manual):

        sethi   const22,reg

const22 is a 22-bit constant that is placed by sethi in the most
significant 22 bits of reg (while it zeroes the 10 least significant
bits of reg). Therefore we would expect the value 0x100000 in %i0
after the execution of ``sethi 16384''. Instead of this, gas
modifies the given constant such that 0x4000 will be found in %i0
afterwards. This would have been equivalent to

        sethi %hi(0x4000),%i0

Anyway, I would like to take this opportunity to forward my severe
thanks to you. For my compilers gas has always been a life safer. The
assembler shipped with Solaris is not just significantly slower, it has
much more severe bugs that are not that easy to live with.

Kind regards, Andreas Borchert.

-- 
Andreas Borchert, Universitaet Ulm, SAI, Helmholtzstr. 18, 89069 Ulm,  Germany
E-Mail: borchert@mathematik.uni-ulm.de
WWW:	http://www.mathematik.uni-ulm.de/sai/borchert/
PGP key available via ``finger borchert@laborix.mathematik.uni-ulm.de''

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1999-04-02 17:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-02  8:04 Bug of gas (binutils-2.9.1.0.23): Wrong code for SETHI on SPARC Andreas Borchert
1999-04-02 11:49 ` H.J. Lu
1999-04-02 16:10 ` H.J. Lu
1999-04-02 16:42   ` Ian Lance Taylor
1999-04-02 16:42     ` H.J. Lu
1999-04-02 16:42       ` Ian Lance Taylor
1999-04-02 17:27     ` H.J. Lu

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 read-only IMAP folder(s) and NNTP newsgroup(s).