This is the mail archive of the gcc@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: [PATCH] Re: ref_contains_indirect_ref always false?


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.


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