From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.lisp.guile.devel Subject: gcc optimisation breaks guile floating point Date: Wed, 28 Aug 2002 00:30:16 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <15723.64888.759743.439428@blauw.xs4all.nl> References: <200208272110.OAA20247@onyx.he.net> Reply-To: hanwen@cs.uu.nl NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1030487216 4963 127.0.0.1 (27 Aug 2002 22:26:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 Aug 2002 22:26:56 +0000 (UTC) Cc: 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 17jonU-0001HV-00 for ; Wed, 28 Aug 2002 00:26:52 +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 17jook-0003KM-00; Tue, 27 Aug 2002 18:28:10 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17jonf-0003Hf-00 for guile-devel@gnu.org; Tue, 27 Aug 2002 18:27:03 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17jonc-0003H5-00 for guile-devel@gnu.org; Tue, 27 Aug 2002 18:27:02 -0400 Original-Received: from smtpzilla1.xs4all.nl ([194.109.127.137]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jonc-0003Gr-00 for guile-devel@gnu.org; Tue, 27 Aug 2002 18:27:00 -0400 Original-Received: from blauw.xs4all.nl (blauw.xs4all.nl [213.84.26.127]) by smtpzilla1.xs4all.nl (8.12.0/8.12.0) with ESMTP id g7RMQtEn034993; Wed, 28 Aug 2002 00:26:56 +0200 (CEST) Original-To: Gary Houston In-Reply-To: <200208272110.OAA20247@onyx.he.net> X-Mailer: VM 7.05 under Emacs 21.2.1 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:1171 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1171 ghouston@arglist.com writes: > > Apparently, "according to ANSI C" (no direct quotation available), the > compiler can assume that *((unsigned long *) z) and *((double *) z) > refer to different locations and reorder the statements! > > I don't know what would be needed to make Guile conform to such > stringent interpretation of the standard, but I don't think it would > be easy to determine that it was correct and that it would always stay > that way. Perhaps we should just add the -fno-strict-aliasing option > if the compiler supports it? I think that these double (as in twice) initializations are weird, and should go. Why not scm_t_double bla; bla.tag = scm_double_tag bla.pad = 0x0 bla.double = z; return scm_double_cell ( ((scm_t_double_cell*) &bla) -> car, ((scm_t_double_cell*) &bla) -> cbr, ((scm_t_double_cell*) &bla) -> ccr, ((scm_t_double_cell*) &bla) -> cdr); If we use -fno-strict-aliasing (a kludge, IMO), we should double check that all inline functions are correct , for clients might not compile with -fno-strict-aliasing. Another option *((unsigned long *) z) = 0; scm_remember ((SCM) z); *((double *) z) = x; return z; -- Han-Wen Nienhuys | hanwen@cs.uu.nl | http://www.cs.uu.nl/~hanwen _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel