This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] TREE_ADDRESSABLE versus ARRAY_TYPE
On Mon, Jan 12, 2004 at 11:00:34AM +0100, Jan Hubicka wrote:
> + static tree
> + discover_nonconstant_array_refs_r (tree * tp, int *walk_subtrees,
> + void *data ATTRIBUTE_UNUSED)
> + {
> + tree t = *tp;
> + if (TYPE_P (t) || DECL_P (t))
> + *walk_subtrees = 0;
> + else if (TREE_CODE (t) == ARRAY_REF)
> + {
> + while ((TREE_CODE (t) == ARRAY_REF
> + && is_gimple_min_invariant (TREE_OPERAND (t, 1)))
> + || (TREE_CODE (t) == COMPONENT_REF
> + || TREE_CODE (t) == REALPART_EXPR
> + || TREE_CODE (t) == IMAGPART_EXPR))
> + t = TREE_OPERAND (t, 0);
> + t = get_base_symbol (t);
> + if (t && DECL_P (t))
> + TREE_ADDRESSABLE (t) = 1;
This will mark *any* array_ref addressable, not just non-constant.
Look at your logic again.
r~