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: tree-ssa/20030807-4.c


In message <20040204075409.GA18910@redhat.com>, Richard Henderson writes:
 >Um, how is it that you expect two if's here?  
 >
 >    cppchar_t i = 0, overflow = 0;
 >    while (*pstr < limit)
 >      {
 >        overflow |= i ^ (i << 4 >> 4);
 >        i = arf ();
 >      }
 >    if (overflow | (i != (i & mask)))
 >
 >I don't see anything that proves that overflow must 
 >contain a non-zero value.  The IFs that I see in the
 >current dom3 are:
 >
 >  if (T.3<D1069>_15 < limit<D1056>_16) goto <L0>; else goto <L2>;
 >
 >	The while loop.  Clearly needed.
 >
 >  if (T.9<D1077>_17 != i<D1060>_1) goto <L12>; else goto <L7>;
 >
 >	Implementing (i != (i & mask)).  We seem to be
 >	somewhat schitzophrenic about doing
 >
 >		T = (x != 0)
 >	    vs
 >		if (x != 0)
 >		   T = 1
 >		else
 >		   T = 0
 >
 >	We should probably pick one or the other, and
 >	canonicalize on it.  I'm not sure what's better
 >	for either rtl or tree-ssa optimizers.
 >
 >	Anyway, we thread the true edge going out, 
 >	which means we're left with ...
 >
 >  if (overflow<D1061>_2 != 0) goto <L12>; else goto <L13>;
 >
 >	This check.  We do skip the OR.
 >
 >
 >You say at
 >
 >   http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00704.html
I *think* what I was shooting for here was to know that overflow
must always be zero, but that's not true since
(i << 4 >> 4)   !=   i

Brain fart.

 >You say at
 >
 >  http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00704.html
 >
 > only that a patch is "in testing".  Did it ever get done?
I _think_ what happened is I had the strange notion about
(i << 4 >> 4) simplifying to "i".   In that warped world it's
about 2 lines of code to the dominator optimizer to build a
suitable expression to hand to the folder.

When it didn't fold as I expected, I put it aside.

I'm just going to zap the test.

jeff


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