This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Virtual operands of &a[1]?


> On Wed, 2003-12-03 at 17:12, Zdenek Dvorak wrote:
> 
> > +       /* If the address is invariant, there may be no interesting variable
> > + 	 references inside.  */
> > +       if (is_gimple_min_invariant (expr))
> > + 	return;
> > + 
> >         /* Avoid recursion.  */
> >         code = subcode;
> >         class = TREE_CODE_CLASS (code);
> 
> And here's the second part as we discussed earlier in the thread.  
> 
> Bootstrapped and tested x86, ia64 and amd64.
> 
> 
> Diego.
> 
> 	* tree-dfa.c (opf_no_vops): New.
> 	(add_stmt_operand): Don't create virtual operands when opf_no_vops
> 	is passed in flags.
> 	(get_expr_operands): Set opf_no_vops flag before diving into the
> 	operand of an ADDR_EXPR node.
> 
> Index: tree-dfa.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
> retrieving revision 1.1.4.195
> diff -d -c -p -r1.1.4.195 tree-dfa.c
> *** tree-dfa.c	3 Dec 2003 22:33:54 -0000	1.1.4.195
> --- tree-dfa.c	4 Dec 2003 02:54:15 -0000
> *************** static const int opf_none	= 0;
> *** 112,117 ****
> --- 112,125 ----
>   /* Operand is the target of an assignment expression.  */
>   static const int opf_is_def 	= 1 << 0;
>   
> + /* No virtual operands should be created in the expression.  This is used
> +    when traversing ADDR_EXPR nodes which have different semantics than
> +    other expressions.  Inside an ADDR_EXPR node, the only operands that we
> +    need to consider are indices into arrays.  For instance, &a.b[i] should
> +    generate a USE of 'i' but it should not generate a VUSE for 'a' nor a
> +    VUSE for 'b'.  */

We will need similar check in verify_stmts, otherwise we will get false
positives as soon as we get out of problem of requring addressable flag
on all arrays.
I will try to look into this.

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]