This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] verify_stmts and verify_ssa
> On Fri, Nov 21, 2003 at 12:53:50PM +0100, Jan Hubicka wrote:
> > + while (((TREE_CODE (t) == ARRAY_REF
> > + || TREE_CODE (t) == COMPONENT_REF)
> > + && is_gimple_min_invariant (TREE_OPERAND (t, 1)))
>
> Still calling is_gimple_min_invariant on a COMPONENT_REF's FIELD_DECL.
I see your point now, so for COMPONENT_REF I don't need to check
anything and they are always shareable (one operand is var_decl and
other is field_decl), right?
+ /* Return true when the T can be shared. */
+ static bool
+ tree_node_shared_p (tree t)
+ {
+ if (TYPE_P (t) || DECL_P (t)
+ || is_gimple_min_invariant (t)
+ || TREE_CODE (t) == SSA_NAME)
+ return true;
+ while ((TREE_CODE (t) == ARRAY_REF
+ && is_gimple_min_invariant (TREE_OPERAND (t, 1)))
+ || (TREE_CODE (t) == INDIRECT_REF
+ || TREE_CODE (t) == COMPONENT_REF
+ || TREE_CODE (t) == REALPART_EXPR
+ || TREE_CODE (t) == IMAGPART_EXPR))
+ t = TREE_OPERAND (t, 0);
+ if (DECL_P (t))
+ return true;
+ return false;
+ }
>
> > + || TREE_CODE (t) == INDIRECT_REF
>
> I don't recall INDIRECT_REF being here before...
It was in following if (originally I did these two separately). This
don't seem to be needed for bootstrap, but I just tought that all REFS
should be shared. I can remove that test if you think it is incorrect
Would be the patch OK with following check? (I am just gonig to test
it)
Honza
>
>
>
> r~