ebevhan added a comment.

Hi! A bit of late feedback on this patch. We found a failure in our downstream 
testing likely originating from here.

The failing case is:

  void f(int a)
  {
      (0 != (a | !0LL));
  }

built with `clang -cc1 -emit-llvm-bc -O2 -v -o foo.bc -x c foo.c`



================
Comment at: clang/lib/Analysis/CFG.cpp:1044
+        case UO_LNot:
+          return llvm::APInt(Value.getBitWidth(), !Value);
+        default:
----------------
This isn't returning an APInt of the right width. It will construct an APInt 
with a width of the input value, but that isn't the same as the required width 
of what a logical not produces; that should have a width of 'int'.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130510/new/

https://reviews.llvm.org/D130510

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to