[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gcc optimisation breaks guile floating point
From: |
Marius Vollmer |
Subject: |
Re: gcc optimisation breaks guile floating point |
Date: |
28 Aug 2002 22:26:12 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Han-Wen Nienhuys <address@hidden> writes:
> 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);
This looks wierd as well, don't you think?
> Another option
>
> *((unsigned long *) z) = 0;
> scm_remember ((SCM) z);
> *((double *) z) = x;
> return z;
I like this better (with a suitable comment of course).
I guess that the funny aliasing behaviour applies only to pointers to
floating point types, right?
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405