This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Re: ref_contains_indirect_ref always false?
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>, Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Fri, 4 Nov 2005 10:17:30 -0500
- Subject: Re: [PATCH] Re: ref_contains_indirect_ref always false?
- References: <10511041507.AA09327@vlsi1.ultra.nyu.edu>
On Friday 04 November 2005 10:07, Richard Kenner wrote:
> #if defined ENABLE_CHECKING
> gcc_assert (handled_component_p (ref))
> #endif
>
> If the comment says it has to be an ARRAY_REF, why not just check for
> that?
The comment is out of sync with the code. It's used in code that may be
sending an arbitrary aggregate.
Given that Dan asked to remove the call from tree-ssa-structalias.c, then
we can take advantage and tighten the two predicates more.
In ref_contains_indirect_ref:
Rename to array_ref_contains_indirect_ref
Add gcc_assert (TREE_CODE (ref) == ARRAY_REF) at the start.
In ref_contains_array_ref:
Leave the gcc_assert I proposed. That predicate is used for more than
COMPONENT_REFs.
The comment needs to be updated.