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] add VRP for bitwise OR and AND: v2


On Thursday 10 August 2006 13:37, Richard Guenther wrote:
> > Immediate TODO is to run patched gcc over this:
> >
> > int main(int a,int b,int c) {
> >     int r;
> >     if(a<0x0100 || a>0x0101) return 1;  // 010x
> >     if(b<0x1000 || b>0x1011) return 1;  // 10xx
> >
> >     r = a & b;
> >     if(r>0x0001) BAD1();
> >
> >     r = a | b;
> >     if(r<0x1110) BAD2();
> >
> >     r = a & c;
> >     if(r<0x0100) BAD3();
> >     if(r>0x0101) BAD4();
> >
> >     r = a & (char)c;
> >     if(r>0x0001) BAD5();
> >
> >     r = a | (char)c;
> >     if(r<0x0100) BAD6();
> >     if(r>0x01ff) BAD7();
> >
> >     return 0;
> > }
> >
> > All calls to BADn() should be optimized out.
> 
> You might want to look at the pending patch for PR15911.

Looked on it. I do not know gcc very much. Doesn't seem to be
about VRP on bitwise AND/OR, no?
--
vda


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