From owner-freebsd-sparc Fri Mar 28 15:41:55 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C445237B401; Fri, 28 Mar 2003 15:41:45 -0800 (PST) Received: from obsecurity.dyndns.org (adsl-63-207-60-150.dsl.lsan03.pacbell.net [63.207.60.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D0F843FA3; Fri, 28 Mar 2003 15:41:44 -0800 (PST) (envelope-from kris@obsecurity.org) Received: from rot13.obsecurity.org (rot13.obsecurity.org [10.0.0.5]) by obsecurity.dyndns.org (Postfix) with ESMTP id 37CC666D9C; Fri, 28 Mar 2003 15:41:44 -0800 (PST) Received: by rot13.obsecurity.org (Postfix, from userid 1000) id 131EE1299; Fri, 28 Mar 2003 15:41:44 -0800 (PST) Date: Fri, 28 Mar 2003 15:41:44 -0800 From: Kris Kennaway To: Thomas Moestl Cc: Kris Kennaway , kan@FreeBSD.ORG, obrien@FreeBSD.ORG, sparc64@FreeBSD.ORG Subject: Re: assembler error in XFree86 snapshot Message-ID: <20030328234143.GA25404@rot13.obsecurity.org> References: <20030116072448.GA29468@rot13.obsecurity.org> <20030116201728.GA279@crow.dom2ip.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline In-Reply-To: <20030116201728.GA279@crow.dom2ip.de> User-Agent: Mutt/1.4i X-Spam-Status: No, hits=-36.4 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 16, 2003 at 09:17:28PM +0100, Thomas Moestl wrote: > On Wed, 2003/01/15 at 23:24:48 -0800, Kris Kennaway wrote: > > I'm trying to compile anholt's XFree86 4.2.99 snapshot on sparc, and I > > get the following error message: > >=20 > > cc -c -O -pipe -ansi -Dasm=3D__asm -Wall -Wpointer-arith -Wundef -I= /usr/tmp/XFree86-4-libraries-devel/work/xc -I/usr/tmp/XFree86-4-libraries-d= evel/work/xc/exports/include -DCSRG_BASED -DFUNCPROTO=3D15 -DNARROWPROTO= -DXTHREADS -D_REENTRANT -D_THREAD_SAFE -DXUSE_MTSAFE_API -DXNO_MTSAFE_PWD= API -DMALLOC_0_RETURNS_NULL XRes.c > > {standard input}: Assembler messages: > > {standard input}:667: Error: relocation overflow > > *** Error code 1 > >=20 > > line 667 of the .s file is: > >=20 > > > .LL86: > > > umul %o0, 4294967295, %o0 >=20 > This is a arguably a gcc bug. All (13-bit) immediate operands are > sign-extended, even those to instructions which operate on unsigned > values, so umul can handle a range of very small and a range of very > large operands. gcc correctly recognizes that it can use an immediate > here; however, it chooses to output it as an unsigned number and does > not sign-extended it from 32 to 64 bit. >=20 > All sign extensions for instructions are made to the full 64 bit > however (even if umul only happens to use 32 of those), so when the > assembler checks whether a value is representable as an immediate, it > will check that the 64-bit sign extension of the immediate creates > the desired value (in sparc64 mode), i.e. it doesn't ignore the upper > 32 bits even if a particular instruction does not use them. >=20 > One solution is to generate negative literals for immediates if we > mean them to be sign-extended (which gcc does already for some other > instructions). The attached patch implements this, I'm not sure it > uses the best possible way to do this though, and it also needs a bit > more testing. Was this ever committed? 4.3.0 fails in the same way: http://bento.freebsd.org/errorlogs/sparc64-5-latest/XFree86-libraries-4.3.0= _1.log cc -c -O -pipe -ansi -Dasm=3D__asm -Wall -Wpointer-arith -Wundef -I/tmp= /a/ports/x11/XFree86-4-libraries/work/xc -I/tmp/a/ports/x11/XFree86-4-libra= ries/work/xc/exports/include -DCSRG_BASED -DFUNCPROTO=3D15 -DNARROWPROTO= -DXTHREADS -D_REENTRANT -D_THREAD_SAFE -DXUSE_MTSAFE_API -DXNO_MTSAFE_PWD= API -DMALLOC_0_RETURNS_NULL XRes.c {standard input}: Assembler messages: {standard input}:667: Error: relocation overflow *** Error code 1 Kris --wRRV7LY7NUeQGEoC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+hN23Wry0BWjoQKURAlQyAKCqAW8ti5tugbOlKx/GAOCiAQUxrgCgumgS iR42w3XiNxZVk2lcF+UWMvw= =iiUW -----END PGP SIGNATURE----- --wRRV7LY7NUeQGEoC-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message