[PATCH] Deal with variable length arrays ending structures in get_base_and_extent
Daniel Berlin
dberlin@dberlin.org
Thu Feb 9 21:31:00 GMT 2006
On Thu, 2006-02-09 at 12:54 -0500, Diego Novillo wrote:
> Richard Guenther wrote:
>
> > Just for convenience. In the case we asserted on we just get back
> > the exp with offset 0, size and maxsize matching the type. But this
> > is an unrelated change and I'll leave that out of this bugfix patch.
> >
> OK.
>
> > I want to say that for the following case
> >
> > typedef struct { struct { int a[1]; } a[1]; } C;
> > int fooC1(C *c, int i, int d)
> > {
> > int j = i+i;
> > c->a[0].a[0] = j;
> > return c->a[0].a[d]; /* Here we can propagate j */
> >
> You mean, "we can't", right? You have no way of knowing if 'd == 0'.
You do know d == 0 (because the array size is only one element), if it
wasn't for the stupid use of malloc tricks on arrays like the above.
More information about the Gcc-patches
mailing list