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
- From: Richard Henderson <rth at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 20 Nov 2003 22:03:00 -0800
- Subject: Re: [tree-ssa] verify_stmts and verify_ssa
- References: <20031121014153.GG12030@kam.mff.cuni.cz>
On Fri, Nov 21, 2003 at 02:41:53AM +0100, Jan Hubicka wrote:
> + if (TREE_CODE (x) == ARRAY_REF
> + || TREE_CODE (x) == COMPONENT_REF
> + || TREE_CODE (x) == REALPART_EXPR
> + || TREE_CODE (x) == IMAGPART_EXPR)
> + x = TREE_OPERAND (x, 0);
This must be a while loop. At least for the ARRAY_REF and
COMPONENT_REF parts.
> + if (TREE_CODE (x) == STRING_CST
> + || TREE_CODE (x) == LABEL_DECL
> + || TREE_CODE (x) == FUNCTION_DECL)
> + return NULL;
> + if (!TREE_ADDRESSABLE (x))
> + return x;
You'd better have a VAR_DECL or PARM_DECL here.
> + if ((TREE_CODE (t) == ARRAY_REF
> + || TREE_CODE (t) == COMPONENT_REF)
> + && DECL_P (TREE_OPERAND (t, 0))
> + && is_gimple_min_invariant (TREE_OPERAND (t, 1)))
Again a while loop. Here you have to be more clever though,
since you've got to check is_gimple_min_invariant for each
ARRAY_REF index. Also, is_gimple_min_invariant is wrong to
apply to the FIELD_DECL of a COMPONENT_REF; I'm surprised
nothing went wrong.
r~