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
Hello,
> > > if (!var)
> > > return NULL_TREE;
> > >
> > > *************** rewrite_use (struct ivopts_data *data,
> > > *** 5745,5750 ****
> > > --- 5760,5766 ----
> > > gcc_unreachable ();
> > > }
> > > update_stmt (use->stmt);
> > > + mark_new_vars_to_rename (use->stmt);
> > > }
> >
> > This should not be necessary with the correct approach -- the alias info
> > should be completely preserved, thus the virtual operands of the
> > statement should not change at all.
>
> It's necessary because of the below change.
regardless of what you do elsewhere, if you cause the virtual operands
of a statement to change in ivopts, then something went wrong.
I think that currently there is no way how to represent subvars info
on TARGET_MEM_REFs correctly. I am trying to do something about it.
Zdenek
> > > Index: tree-ssa-operands.c
> > > ===================================================================
> > > RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
> > > retrieving revision 2.97
> > > diff -c -3 -p -r2.97 tree-ssa-operands.c
> > > *** tree-ssa-operands.c 20 Jul 2005 01:18:26 -0000 2.97
> > > --- tree-ssa-operands.c 21 Jul 2005 12:24:35 -0000
> > > *************** get_tmr_operands (tree stmt, tree expr,
> > > *** 1698,1704 ****
> > > }
> > >
> > > if (tag)
> > > ! add_stmt_operand (&tag, stmt_ann (stmt), flags);
> > > else
> > > /* Something weird, so ensure that we will be careful. */
> > > stmt_ann (stmt)->has_volatile_ops = true;
> > > --- 1698,1709 ----
> > > }
> > >
> > > if (tag)
> > > ! {
> > > ! if (TREE_CODE (tag) == SSA_NAME)
> > > ! add_stmt_operand (&tag, stmt_ann (stmt), flags);
> > > ! else
> > > ! get_expr_operands (stmt, &tag, flags);
> > > ! }
> > > else
> > > /* Something weird, so ensure that we will be careful. */
> > > stmt_ann (stmt)->has_volatile_ops = true;
> >
> > Why is this change necessary? And, how it can happen that TMR_TAG is an
> > SSA name?
>
> We need to call get_expr_operands on the tag, if it is a VAR_DECL
> (I reversed the condition - maybe I goofed and should just use != VAR_DECL
> here). This is because get_expr_operands takes care inserting all subvars
> here, if necessary. Maybe we can do this unconditionally - but I do
> understand too little about all the interworkings, so I'm just trying.
>
> Richard.