rsmith added a comment.

In D85256#2211129 <https://reviews.llvm.org/D85256#2211129>, @rsmith wrote:

> This appears to be a general problem: the `GetExprRange` mechanism in 
> SemaChecking miscomputes the ranges for `+`, `*`, and `-` expressions, and 
> we'll get them wrong for all warnings that use that mechanism :-(

See https://reviews.llvm.org/D85778 for a fix. We were intentionally 
miscomputing the expression ranges in order to give conservative 
narrowing-conversion results for cases like `char a = some_char + 1;` (which is 
technically lossy because the RHS could be `CHAR_MAX + 1`, but is probably 
fine), and this caused us to similarly compute that `(a & 1) + (b & 1)` was in 
the range [0, 1], not [0, 2].


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85256

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D85256: A... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Dávid Bolvanský via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Dávid Bolvanský via Phabricator via cfe-commits
    • [PATCH] D852... Richard Trieu via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Stephan Bergmann via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits

Reply via email to