On 8/11/06, Denis Vlasenko <vda.linux@xxxxxxxxxxxxxx> wrote:
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?
No, but it should help the TRUTH_OR_EXPR you have in
if(a<0x0100 || a>0x0101) return 1;
if that is not lowered to chained ifs.
Richard.
|