This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] Start to use VIEW_CONVERT_EXPR more and start to fix PR 26069
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 03 Dec 2006 10:02:07 -0800
- Subject: Re: [PATCH/RFC] Start to use VIEW_CONVERT_EXPR more and start to fix PR 26069
- References: <1157415451.24185.114.camel@celery.andrew.com> <4501DA8D.9060200@redhat.com>
On Fri, 2006-09-08 at 17:03 -0400, Diego Novillo wrote:
> > Index: tree-ssa-operands.c
> > ===================================================================
> > --- tree-ssa-operands.c (revision 116671)
> > +++ tree-ssa-operands.c (working copy)
> > @@ -1843,6 +1843,11 @@ get_expr_operands (tree stmt, tree *expr
> >
> > switch (code)
> > {
> > + case VIEW_CONVERT_EXPR:
> > + if (flags & opf_is_def)
> > + add_to_addressable_set (TREE_OPERAND (expr, 0), &s_ann->addresses_taken);
> > + goto do_unary;
> > +
> >
> Not OK. This can't be right. VCE does not take the address of its
> operand. Only ADDR_EXPR does. I think you're papering over another
> problem here. The comment in tree.def about addressability applies to
> VCE on the LHS and to the expression, not the operand.
If I fix up verify_ssa like:
Index: tree-ssa.c
===================================================================
--- tree-ssa.c (revision 119218)
+++ tree-ssa.c (working copy)
@@ -758,9 +758,14 @@ verify_ssa (bool check_modified_stmt)
lhs = TREE_OPERAND (stmt, 0);
base_address = get_base_address (lhs);
+ /* Check that all memory stores have at least one
V_MAY_DEF or V_MUST_DEF.
+ VIEW_CONVERT_EXPR<SSA_NAME> is not a memory store but a
complete clobbering
+ of the SSA_NAME. */
if (base_address
&& SSA_VAR_P (base_address)
- && ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|
SSA_OP_VMUSTDEF))
+ && ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|
SSA_OP_VMUSTDEF)
+ && (TREE_CODE (lhs) != VIEW_CONVERT_EXPR
+ || TREE_OPERAND (lhs, 0) != base_address))
{
error ("statement makes a memory store, but has no "
"V_MAY_DEFS nor V_MUST_DEFS");
I still have an issue with stuff like:
VIEW_CONVERT_EXPR<struct a>(b_1).c = f_1
But this is because this MODIFY_EXPR is only a partial definition of the
variable b_1. I am thinking we to generalize DECL_COMPLEX_GIMPLE_REG_P
to DECL_GIMPLE_REG_P for this case.
Thanks,
Andrew Pinski