From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Gary Houston Newsgroups: gmane.lisp.guile.devel Subject: Re: gcc optimisation breaks guile floating point Date: 30 Aug 2002 18:44:17 +0100 Sender: guile-devel-admin@gnu.org Message-ID: <200208301751.KAA21818@onyx.he.net> References: <200208272110.OAA20247@onyx.he.net> <15723.64888.759743.439428@blauw.xs4all.nl> <8765xuzq57.fsf@zagadka.ping.de> <15725.21637.516981.623205@blauw.xs4all.nl> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1030729870 6427 127.0.0.1 (30 Aug 2002 17:51:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 30 Aug 2002 17:51:10 +0000 (UTC) Cc: mvo@zagadka.ping.de, guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17kpvH-0001fR-00 for ; Fri, 30 Aug 2002 19:51:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17kpwg-0006Fo-00; Fri, 30 Aug 2002 13:52:34 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17kpvd-0006Br-00 for guile-devel@gnu.org; Fri, 30 Aug 2002 13:51:29 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17kpvb-0006Bf-00 for guile-devel@gnu.org; Fri, 30 Aug 2002 13:51:29 -0400 Original-Received: from onyx.he.net ([216.218.161.2]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17kpvb-0006Bb-00 for guile-devel@gnu.org; Fri, 30 Aug 2002 13:51:27 -0400 Original-Received: from onyx.he.net (onyx.he.net [216.218.161.2]) by onyx.he.net (8.8.6/8.8.2) with ESMTP id KAA21818 for ; Fri, 30 Aug 2002 10:51:29 -0700 Original-Received: (qmail 10118 invoked from network); 30 Aug 2002 17:44:17 -0000 Original-Received: from localhost (HELO x.localnet) (127.0.0.1) by localhost with SMTP; 30 Aug 2002 17:44:17 -0000 Original-To: hanwen@cs.uu.nl In-Reply-To: <15725.21637.516981.623205@blauw.xs4all.nl> (message from Han-Wen Nienhuys on Thu, 29 Aug 2002 00:53:57 +0200) Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1205 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1205 > From: Han-Wen Nienhuys > Date: Thu, 29 Aug 2002 00:53:57 +0200 > > > > *((unsigned long *) z) = 0; > > > scm_remember ((SCM) z); > > > *((double *) z) = x; > > > return z; > > > > I like this better (with a suitable comment of course). > > In CVS. Thanks, that's better: guile> 3.2 3.2 However scm_double_cell itself probably needs to be fixed, otherwise this problem will turn up again some day, or in user code (I'll look at it myself if it's still a problem in a couple of weeks.) > > I guess that the funny aliasing behaviour applies only to pointers to > > floating point types, right? > > I wouldn't be sure. It could happen with all sorts of initializations, > I guess, but I'm not familiar enough with the source code to see which > ones. I've read that it happens whenever the types differ significantly, e.g., int vs double or int vs struct both have the problem. I wonder if two different struct types would cause it, e.g., the old trick: struct foo { struct bar { } ... } with casting of pointers between foo and bar objects. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel