On 2018-09-20 11:13:59 -0400, Jason Merrill wrote:
> Indeed, whether this sort of warning is a false positive depends on
> values, which the optimizers can always do better with.  We could
> build some logic into the front end, e.g. recognize that a &
> expression will always fit in the smallest of its operand types, but

This is not true with int & signed char, where the signed char
is negative.

> on the other hand that duplicates things that other parts of the
> compiler already deal with, so there's a question of how to share
> these rules between front and middle end, like we're doing more of
> with constant folding.  Perhaps we could use the folder somehow.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to