unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: prj@po.cwru.edu (Paul Jarc)
Cc: guile-devel@gnu.org, Greg Troxel <gdt@ir.bbn.com>
Subject: aliasing (was: guile loses on NetBSD/sparc64 1.6.2 with gcc 3.3.2)
Date: Fri, 27 Feb 2004 13:38:41 -0500	[thread overview]
Message-ID: <m3wu68l648.fsf_-_@multivac.cwru.edu> (raw)
In-Reply-To: <87vfls2yp8.fsf@raven.defaultvalue.org> (Rob Browning's message of "Fri, 27 Feb 2004 11:56:35 -0600")

Rob Browning <rlb@defaultvalue.org> wrote:
> Also, I think you may be able to use a union safely as an
> alternative with gcc, but from what I recall, that's non-standard.

I don't think it's generally possible for gcc to handle that case
specially.  Consider:

void foo(int* i, float* f) { *i=42; *f=3.14159; }

void bar(void) {
  union { int i; float f; } u;
  foo(&u.i, &u.f);
  /* What's in u.f now? */
}

These functions could appear in different source files.  So when foo
is being compiled, the compiler can't know whether i and f point to
overlapping members of the same union.  It assumes they don't overlap
because of their types, and reorders the writes if it likes.


paul


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


      reply	other threads:[~2004-02-27 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-25 19:06 guile loses on NetBSD/sparc64 1.6.2 with gcc 3.3.2 Greg Troxel
2004-02-25 23:02 ` Rob Browning
2004-02-26  0:55   ` Greg Troxel
2004-02-26 19:52     ` Rob Browning
2004-02-27 16:23       ` Greg Troxel
2004-02-27 16:27         ` Rob Browning
2004-02-27 17:20           ` Paul Jarc
2004-02-27 17:56             ` Rob Browning
2004-02-27 18:38               ` Paul Jarc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3wu68l648.fsf_-_@multivac.cwru.edu \
    --to=prj@po.cwru.edu \
    --cc=gdt@ir.bbn.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).