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: 3 Oct 2002 00:34:09 +0100 Sender: guile-devel-admin@gnu.org Message-ID: <200210022335.QAA18013@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> <200208301751.KAA21818@onyx.he.net> <15735.51280.569410.22724@blauw.xs4all.nl> <200209242233.PAA04201@onyx.he.net> <87bs6czcpz.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1033713514 5650 127.0.0.1 (4 Oct 2002 06:38:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 4 Oct 2002 06:38:34 +0000 (UTC) Cc: cwitty@newtonlabs.com, hanwen@cs.uu.nl, 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 17xM6T-0001SO-00 for ; Fri, 04 Oct 2002 08:38:30 +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 17xLgG-0001Az-00; Fri, 04 Oct 2002 02:11:20 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17wt1q-0003jz-00 for guile-devel@gnu.org; Wed, 02 Oct 2002 19:35:42 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17wt1n-0003ih-00 for guile-devel@gnu.org; Wed, 02 Oct 2002 19:35:41 -0400 Original-Received: from onyx.he.net ([216.218.161.2]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17wt1n-0003id-00 for guile-devel@gnu.org; Wed, 02 Oct 2002 19:35:39 -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 QAA18013 for ; Wed, 2 Oct 2002 16:35:43 -0700 Original-Received: (qmail 17147 invoked from network); 2 Oct 2002 23:34:09 -0000 Original-Received: from localhost (HELO x.localnet) (127.0.0.1) by localhost with SMTP; 2 Oct 2002 23:34:09 -0000 Original-To: mvo@zagadka.ping.de In-reply-to: <87bs6czcpz.fsf@zagadka.ping.de> (message from Marius Vollmer on 03 Oct 2002 00:40:24 +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:1423 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1423 > Cc: cwitty@newtonlabs.com, hanwen@cs.uu.nl, guile-devel@gnu.org > From: Marius Vollmer > Date: 03 Oct 2002 00:40:24 +0200 > > Gary Houston writes: > > > > Under gcc, the following statement: > > > > > > asm volatile ("" : : : "memory"); > > > > > > [...] > > > > This is good, it's similar to a previous work-around in libguile/throw.c. > > I haven't checked with the standard, but it might be the case that a > compiler must assume that a pointer to char can alias any type. Thus, > > #define SCM_REAL_VALUE(x) (((scm_t_double *)((char *)SCM2PTR (x)))->real) > > might work as well. I tried the extra cast on the simple test case, but it doesn't help. In ANSI C any such assumption would be for void *, not char *, but the pointer was void * already. #include #include static void * make_z (double x) { void *z = malloc (50); memset (z, 0, 50); *((unsigned long *) z) = 0; *((double *) z) = x; return z; } main () { void *z = make_z (3.2); double d = *((double *) z); int i; for (i = 0; i < sizeof (double); i++) { printf ("%d\n", ((unsigned char *) &d)[i]); } return 0; } _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel