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: [PATCH][RFC] Do some vectorizer-friendly canonicalization before vectorization


On Tue, 21 Nov 2006, Zdenek Dvorak wrote:

> Hello,
> 
> > +   /* Catch squaring.  */
> > +   if ((host_integerp (exp, 0)
> > +        && TREE_INT_CST_LOW (exp) == 2)
> 
> tree_low_cst (exp, 0) == 2.  Otherwise, the patch is OK.

I don't think so.

HOST_WIDE_INT
tree_low_cst (tree t, int pos)
{
  gcc_assert (host_integerp (t, pos));
  return TREE_INT_CST_LOW (t);
}

so we'll ICE if it is not host_integerp (and if you suggested to
only change TREE_INT_CST_LOW we'd get a redundant call to
host_integerp).

Though

rguenther@murzim:/space/rguenther/src/svn/trunk/gcc> grep -C 3 
host_integerp *.c | grep TREE_INT_CST_LOW | wc -l
24
rguenther@murzim:/space/rguenther/src/svn/trunk/gcc> grep -C 3 
host_integerp *.c | grep tree_low_cst | wc -l
84

shows using tree_low_cst even after checking host_integerp seems common.

So I'll switch to tree_low_cst in place of TREE_INT_CST_LOW.

Thanks,
Richard.

--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs


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