From owner-freebsd-current Sat Dec 21 15:38:52 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33CFF37B405; Sat, 21 Dec 2002 15:38:50 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id B810843ED8; Sat, 21 Dec 2002 15:38:48 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id KAA24050; Sun, 22 Dec 2002 10:38:45 +1100 Date: Sun, 22 Dec 2002 10:40:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Tim Robbins Cc: Juli Mallett , Joe Marcus Clarke , Subject: Re: WEIRD! div() broken on -CURRENT? In-Reply-To: <20021221162001.A17127@dilbert.robbins.dropbear.id.au> Message-ID: <20021222103405.A7492-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 21 Dec 2002, Tim Robbins wrote: > On Fri, Dec 20, 2002 at 08:43:25PM -0800, Juli Mallett wrote: > > > * De: Tim Robbins [ Data: 2002-12-20 ] > > [ Subjecte: Re: WEIRD! div() broken on -CURRENT? ] > > > On Fri, Dec 20, 2002 at 09:24:39PM -0500, Joe Marcus Clarke wrote: > > > > I'm doing something wrong, right? I mean, this can't be right. I've > > > > verified this now on a P4 running: > > > [...] > > > > > > I can reproduce it here. It looks like gcc is using a strange calling > > > convention that the i386 div.S does not understand (MI div.c seems to, though). > > > > TenDRA and GCC3 use a different struct return format than we used to > > use (see http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01783.html) and > > we never had a flag day for the old format, and there's no UPDATING or > > whatnot notes about this AFAIK. This means at least div has to change > > to use the new calling convention. > [...] > > I've imported the versions of div.S and ldiv.S from NetBSD HEAD which > work properly with the new calling convention. Thanks for mentioning (on IRC) > that the pcc struct return convention had something to do with it. Did we really mean to change this? It is a relatively recent change. From cvs history: % RCS file: /home/ncvs/src/contrib/gcc/config/freebsd.h,v % Working file: freebsd.h % head: 1.37 % ... % ---------------------------- % revision 1.37 % date: 2002/04/30 17:22:42; author: obrien; state: Exp; lines: +34 -460 % MI bits for Gcc 3.1. % ---------------------------- This contains mounds changes, one of which breaks 5-10 (?) years of binary compatibility within gcc-compiled objects: % Index: freebsd.h % =================================================================== % RCS file: /home/ncvs/src/contrib/gcc/config/freebsd.h,v % retrieving revision 1.36 % retrieving revision 1.37 % diff -u -2 -r1.36 -r1.37 % --- freebsd.h 14 May 2001 22:45:26 -0000 1.36 % +++ freebsd.h 30 Apr 2002 17:22:42 -0000 1.37 % ... % -/* Don't default to pcc-struct-return, because gcc is the only compiler, and % - we want to retain compatibility with older gcc versions % - (even though the SVR4 ABI for the i386 says that records and unions are % - returned in memory). */ % -#undef DEFAULT_PCC_STRUCT_RETURN % -#define DEFAULT_PCC_STRUCT_RETURN 0 I think gcc didn't override its default of DEFAULT_PCC_STRUCT_RETURN = 1 on i386's meany years ago, since bcc uses this method of returning structs and ISTR copying the gcc behaviour. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message