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, Richard Guenther wrote:
> On Tue, 19 Jul 2005, Richard Guenther wrote:
>
> > On Tue, 19 Jul 2005, Richard Guenther wrote:
> >
> > >
> > > 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.
>
> The problem is, that for the testcase below we create a TARGET_MEM_REF
> with base &a, which traces back to the affine combination and considering
> &a as IV candidate base:
>
> use 0
> address
> in statement D.1614_9 = a.x[i_12]
> at position a.x[i_12]
> type int *
> base &a.x[0]
> step 4
> base object (void *) &a
> related candidates
>
> we should use &a.x[0] as base for the TARGET_MEM_REF, not the
> base object (void *) &a. Or somehow fix get_tmr_operands or
> the mem_ref code setting TMR_TAG through get_ref_tag. I'm really
> lost here.
Well - "fixing" the ICEs is easy by
Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.84
diff -c -3 -p -r2.84 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c 11 Jul 2005 23:59:11 -0000 2.84
--- tree-ssa-loop-ivopts.c 19 Jul 2005 10:52:18 -0000
*************** get_ref_tag (tree ref)
*** 5455,5461 ****
if (tag)
return tag;
! return var;
}
return NULL_TREE;
--- 5455,5461 ----
if (tag)
return tag;
! return NULL_TREE;
}
return NULL_TREE;
but of course this will cause miscompilations later on.
Richard.