This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Enable saliasing for structs with arrays
On Tue, 19 Jul 2005, Zdenek Dvorak wrote:
> Hello,
>
> > > This simple patch enables structure aliasing for structs containing
> > > arrays (_not_ enabling subvars for the arrays). Unfortunately, the
> > > patch breaks bootstrap due to IVOPTs and friends. This is sad, as
> > > it may even help for better alias analysis for GCCs tree structure.
> > >
> > > Maybe some IVOPTs folks can help out here.
>
> tree-ssa-loop-ivopts.c:copy_ref_info does not handle the subvars at all,
> currently. I will check what I can do.
For TARGET_MEM_REFs being nice to me (i.e. have a TMR_SYMBOL) I was
able to fix the aliasing issues. But now, f.i. for the testcase
static union {
char buf[100];
double foo;
} u2;
extern void foobar (char *);
main ()
{
int off2, len;
char *p;
for (len = 1; len < 100; len++)
{
u2.buf[off2 + len] = '\0';
foobar (u2.buf + off2);
}
return 0;
}
we generate TARGET_MEM_REFs with neither TMR_SYMBOL, nor TMR_TAG for
'u2.buf[off2 + len] = '\0';' -- this sucks. TARGET_MEM_REFs would
fit nicely with subvars and aliasing, if they only always had all
necessary information filled in.
Richard.