Relational comparison with bitwise results is always true/false

Richard Trieu rtrieu at google.com
Mon Aug 25 14:23:53 PDT 2014


I brought up the same question last year.  By including this in the CFG
builder, the other analysis that use the CFG can use the tautological
results for better diagnostics.

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131028/091857.html




On Mon, Aug 25, 2014 at 12:30 PM, Richard Smith <richard at metafoo.co.uk>
wrote:

> On Mon, Aug 25, 2014 at 9:19 AM, Anders Rönnholm <
> Anders.Ronnholm at evidente.se> wrote:
>
>> Hi,
>>
>> I have made a new bitwise comparison always true check for relational
>> comparisons i'd like to get reviewed.
>>
>> e.g
>> if ((x & 64) < 65) // bitwise comparison always evaluates to true
>
>
> I'm very surprised to see this being implemented in Analysis/CFG.cpp; this
> belongs in Sema/SemaChecking.cpp. It makes no sense to me to couple this
> check to building a CFG.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140825/22ebf550/attachment.html>


More information about the cfe-commits mailing list