[PATCH] D20845: DAGCombiner: Fix broken size check in isAlias

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 17:26:20 PDT 2016


hfinkel added a comment.

In http://reviews.llvm.org/D20845#445129, @hfinkel wrote:

> LGTM
>
> Can you open a PR against Clang here? We should warn on this, the term (the boolean, 1 or 0, shifted right by three) is always zero. I assume the general warning here is considering the boolean to be a byte in size for some reason.


Specifically, I would have expected this warning:

  /tmp/f.c:2:12: warning: shift count >= width of type [-Wshift-count-overflow]
    return a >> 48;
             ^  ~~
  1 warning generated.
  
  $ cat /tmp/f.c 
  int test(int a) {
    return a >> 48;
  }


http://reviews.llvm.org/D20845





More information about the llvm-commits mailing list