From: Daniel Berlin <dberlin@dberlin.org>
To: Diego Novillo <dnovillo@redhat.com>
Cc: Richard Kenner <kenner@vlsi1.ultra.nyu.edu>,
"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: [RFC] ignoring type alias conflicts between structures and scalars
Date: Thu, 25 Nov 2004 17:39:00 -0000 [thread overview]
Message-ID: <1101401621.6587.9.camel@linux.site> (raw)
In-Reply-To: <1101400529.31231.105.camel@localhost.localdomain>
On Thu, 2004-11-25 at 11:35 -0500, Diego Novillo wrote:
> On Thu, 2004-11-25 at 11:22 -0500, Richard Kenner wrote:
>
> > If I have two pointers, one to struct_int_float and one to int, it's
> > certainly the case that a store into one can affect what's pointed to by the
> > other and that's what the alias set conflict is trying to address.
> >
> No, we have one pointer and one regular variable. I understand that an
> 'int *' may point to a field of 'struct int_float_s'.
>
> > So what *exactly* are you trying to test?
> >
> It's in my original message. Given:
>
> struct int_float_s {
> int i;
> int f;
> };
>
> int X;
>
> foo()
> {
> struct int_float_s *x = bar();
> X = 10;
> x->i = 3;
> return X;
> }
>
> I don't want to consider 'X = 10' and 'x->i = 3' to be stores to the
> same memory location. That is, I want the optimizers to assume that
> pointer 'x' cannot possibly be pointing to 'X'.
These two statements are saying the same thing about two different
types.
(*x).i == int
X == int
Thus, they can alias, AFAIK
*x == struct int_float_s
X == int
Thus, they can't alias.
So while x can't alias with X, it can X can alias with x->i.
AFAIK.
--Dan
PS i like how you named a structure containing only ints "int_float_s"
:)
next prev parent reply other threads:[~2004-11-25 16:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-25 16:28 Richard Kenner
2004-11-25 16:53 ` Diego Novillo
2004-11-25 17:39 ` Daniel Berlin [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-11-25 21:02 Richard Kenner
2004-11-25 21:17 ` Diego Novillo
2004-11-25 18:03 Richard Kenner
2004-11-25 17:48 Richard Kenner
2004-11-25 16:11 Richard Kenner
2004-11-25 16:02 Richard Kenner
2004-11-25 16:12 ` Diego Novillo
2004-11-25 16:28 ` Andrew Pinski
2004-11-25 15:38 Diego Novillo
2004-11-25 16:18 ` Daniel Berlin
2004-11-25 17:48 ` Nathan Sidwell
2004-11-25 18:03 ` Joseph S. Myers
2004-11-25 20:55 ` Jeffrey A Law
2004-11-25 20:58 ` Diego Novillo
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1101401621.6587.9.camel@linux.site \
--to=dberlin@dberlin.org \
--cc=dnovillo@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=kenner@vlsi1.ultra.nyu.edu \
/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).