Re: [RFC] proof-of-concept: warning for a bit comparison that is always true/false

2014-04-16 Thread Daniel Marjamäki
Thanks! > I'd actually do this down at the gimple level. You'll have an SSA graph you > can use to identify the masking and verify its producing a single bit result. > You'll also have canonicalized comparisons, so there'll be fewer things to > test. Depending on exactly where you put the op

Re: [RFC] proof-of-concept: warning for a bit comparison that is always true/false

2014-04-16 Thread Jeff Law
On 04/16/14 09:27, Daniel Marjamäki wrote: Hello! I am new to GCC. I want to add a warning to GCC when bit comparison is always true/false. Example: if ((x&4)==0) {} // <- no warning if ((x&4)==4) {} // <- no warning if ((x&4)==5) {} // <- warn! When this warning is trigg