List of simplifications we should perform

Richard Earnshaw rearnsha@arm.com
Fri May 11 05:13:00 GMT 2001


> 
> 
> On 11 May 2001, Andi Kleen wrote:
> 
> > Daniel Berlin <dan@www.cgsoftware.com> writes:
> >
> > If this is supposed to be C...
> >
> > > Simplifications for ~ and !:
> > >
> > >    ! ! j			j
> >
> > !!j is not j, it is j?1:0.
> >
> That's what I thought, but SGI's compiler quite clearly disagrees.
> It just says:
> 
> if (<it's of the form ! ! j>)
> 	delete the not's.
> 
> It performs this at all optimization levels, too.

Then it looks like a bug, since clearly 

	x + !!j != x + j

Just consider j = 2

R.



More information about the Gcc mailing list