[PATCH] D44559: [Sema] Wrong width of result of mul operation

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 10:13:33 PDT 2018


rjmccall added a comment.

In https://reviews.llvm.org/D44559#1048085, @avt77 wrote:

> In https://reviews.llvm.org/D44559#1045758, @rjmccall wrote:
>
> > No, I still oppose this patch.
>
>
> OK, we have 2 possibilities here (fmpov):
>
> 1. Forget about the issue and don't do anything now - it is not a bug
> 2. Return the width based on real analyze of mul args:
>   - signed vs. unsigned
>   - chars, shorts, etc. What do you suggest to do? Or maybe there are other variants?


I think we just close this.  If you want to put time into trying to diagnose in Aaron's example of uint8 * uint -> signed short, I think the right approach is to enhance IntRange so that it can optionally carry a more aggressive range, and then make -Wsign-compare use that when available.  That's a significantly different patch from this.


https://reviews.llvm.org/D44559





More information about the llvm-commits mailing list