public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* An old gas bug
@ 1994-08-16 16:04 H.J. Lu
  1994-08-17  6:08 ` Michael Meissner
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 1994-08-16 16:04 UTC (permalink / raw)
  To: gas2

Hi,

This is a very old bug date back to 1.38.1. The reason no one really
cares is gcc won't generate that kind of code, i.e., jump out of range.
When some Linux people were working on X11R5, they used an Intel x86
branch/loop instruction, jcxz, which has only byte displacements in
the hand coded asm code. The AT&T as worked fine with expansion. But
gas 1.38.1 generated some bogus codes. I fixed the bug for them. I
think it is correct. The test case is very easy to produce. Please let
me know if you need one.

-- 
H.J. Lu
NYNEX Science and Technology, Inc.			hjl@nynexst.com
----
Tue Aug 16 18:48:10 1994  H.J. Lu (hlu@nynexst.com)

	* write.c (fixup_segment): fix the displacement range
	  checking. "add_number" may be signed and is of type int.
	  We only shift by size * 8 - 1.

*** gas/write.c	Thu Jul 14 14:57:47 1994
--- gas/write.c.new	Tue Aug 16 18:47:11 1994
***************
*** 2195,2202 ****
  		 half-way operations should both be defined.  And the
  		 compiler should be able to combine them if it's valid on
  		 the host architecture.  */
! 	      mask <<= size * 4;
! 	      mask <<= size * 4;
  	      if ((add_number & mask) != 0
  		  && (add_number & mask) != mask)
  		{
--- 2195,2201 ----
  		 half-way operations should both be defined.  And the
  		 compiler should be able to combine them if it's valid on
  		 the host architecture.  */
! 	      mask <<= size * 8 - 1;
  	      if ((add_number & mask) != 0
  		  && (add_number & mask) != mask)
  		{


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <199408171947.PAA12811@sanguine.cygnus.com>]

end of thread, other threads:[~1994-08-17 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-08-16 16:04 An old gas bug H.J. Lu
1994-08-17  6:08 ` Michael Meissner
1994-08-17  6:16   ` H.J. Lu
     [not found] <199408171947.PAA12811@sanguine.cygnus.com>
1994-08-17 14:36 ` 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).