This is the mail archive of the gcc-patches@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: Fix random hashing problems with ARRAY_REF and COMPONENT_REF


On Tue, 20 Jul 2004, Richard Kenner wrote:
> +      ??? This is temporary and is meant only to handle the cases of the
> +      optional operands for COMPONENT_REF and ARRAY_REF.  */
> +   if ((arg0 && !arg1) || (!arg0 && arg1))
> +     return 0;
> +   else if (!arg0 && !arg1)
> +     return 1;

Wouldn't it be preferable to handle these cases in the recursive calls to
COMPONENT_REF and ARRAY_REF instead of slowing down the critical path for
every invocation of operand_equal_p?

If you do leave this code where it is, it's probably better written as:

	if (!arg0 || !arg1)
	  return !arg0 && !arg1;

Roger
--


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