This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: alias.c:nonoverlapping_component_refs_p


On Mon, Dec 03, 2001 at 06:26:12PM -0500, Richard Kenner wrote:
> But that's if there's no record rep clause.  If there is, then the
> hierarchy is collapsed and it's represented as a single RECORD_TYPE.
> Also, subtypes get collapsed similarly.

Err.. why?  What can you do with a collapsed represenation that
you can't do with the uncollapsed representation?  It's all 
compiler internals after all...

> I don't follow.  Why isn't this known from the tree?  Are you concerned about
> value propagation of pointers here?

Yes.  In particular,

struct S {
  long w, x, y, z;
};

static inline void foo(struct S *s) { s->x = 0; }
extern void bar(struct S *s);

struct S test(void)
{
  struct S asdf;
  foo(&asdf);
  bar(&asdf);
}

I'd expect this sort of example to be fairly common in C++, where
FOO winds up being an inline member function and the passed struct
being the object manipulated.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]