From owner-freebsd-current@FreeBSD.ORG Tue May 27 05:14:59 2003 Return-Path: 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 7E85A37B401; Tue, 27 May 2003 05:14:59 -0700 (PDT) Received: from mail.qubesoft.com (gate.qubesoft.com [217.169.36.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CA2443F93; Tue, 27 May 2003 05:14:58 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from bluebottle.qubesoft.com (bluebottle.qubesoft.com [192.168.1.2]) by mail.qubesoft.com (8.12.9/8.12.6) with ESMTP id h4RCEc1H062155; Tue, 27 May 2003 13:14:38 +0100 (BST) (envelope-from dfr@nlsystems.com) Received: from builder02.qubesoft.com (builder02.qubesoft.com [192.168.1.8]) h4RCEUpk062408; Tue, 27 May 2003 13:14:37 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: Bruce Evans In-Reply-To: <20030527200208.L1802@gamplex.bde.org> References: <200305201025.30296.jlido@goof.com> <20030522093623.30915ed0.fearow@attbi.com> <20030522173256.GA81438@dragon.nuxi.com> <200305270942.42945.dfr@nlsystems.com> <20030527200208.L1802@gamplex.bde.org> Content-Type: text/plain Organization: Message-Id: <1054037670.9662.6.camel@builder02.qubesoft.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 27 May 2003 13:14:30 +0100 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-32.4 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_XIMIAN version=2.53 X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp) cc: freebsd-current@freebsd.org Subject: Re: gcc/libm floating-point bug? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2003 12:14:59 -0000 On Tue, 2003-05-27 at 11:10, Bruce Evans wrote: > On Tue, 27 May 2003, Doug Rabson wrote: > > > On Thursday 22 May 2003 6:32 pm, David O'Brien wrote: > > > On Thu, May 22, 2003 at 09:36:23AM -0500, Anti wrote: > > > > p4 should expand to "-march=pentium4 -mno-sse2" > > > > > > If we are going to make any change, it should be one we know will > > > deal with the issue once and for all. I also considered submitting a > > > patch like that, but it is too late in the game to figure out if > > > "-march=pentium4 -mno-sse2" would be sufficient in all cases. > > > > Even for special cases, it is hard to use -msse (or -msse2) with > > gcc-3.2.x since it doesn't always manage to 16-byte align the stack > > pointer. This makes it hard to declare local vector float variables > > safely. All of this appears to be fixed in gcc-3.3-prerelease at least. > > Isn't this "fixed" in gcc-3.any (gcc-3.2 on i386's at least) except > for signal stacks which are partly the kernel's responsibility? gcc-3.2 > still pessimizes stack alignment and invites bugs by doing it in > functions that don't need it and depending on callers doing it. When I was experimenting with this recently using our current compiler (gcc-3.2.2-ish?) it was quite broken. It carefully managed the stack pointer in main so that it was aligned at the point of calling my test function. This meant that pushing the return address broke the alignment and since the callee expected a 16-byte aligned stack, it faulted the first time it tried to use 'movaps' (16-byte vector float move) on a stack variable. The intel compiler inserts code into the function profile which enforces alignment where necessary. This might be the better approach when not all functions need the alignment.