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]?


Hello,

> > > To deal with this, we should do a separate walk of the ADDR_EXPR operand
> > > looking for ARRAY_REFs and adding their operands.  You cannot just block
> > > vuse operands, because if 'i' and 'j' happened to be aliased, you would
> > > fail to add them as operands.
> > 
> > But they cannot be here since otherwise gimple_min_invariant would not
> > be true?
> > 
> Ah, indeed.  The gimplifier would've converted &ptr->q.a[i]->b[j] into
> i.1 = i;
> j.1 = j;
> ... &ptr->q.a[i.1]->b[j.1]
> 
> In that case, the call to walk_tree() I just added is unnecessary.  Just
> blocking vuses ought to work.

you mean something like the original patch?  Or even this (it also bootstraps
and passes regtesting on i686)?

Zdenek

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.194
diff -c -3 -p -r1.1.4.194 tree-dfa.c
*** tree-dfa.c	2 Dec 2003 22:57:59 -0000	1.1.4.194
--- tree-dfa.c	3 Dec 2003 19:59:55 -0000
*************** get_expr_operands (tree stmt, tree *expr
*** 357,362 ****
--- 357,367 ----
  	  && subcode != ARRAY_REF)
  	return;
  
+       /* 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);


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