------- Comment #7 from manu at gcc dot gnu dot org 2008-02-15 16:53 ------- So fold_unary is transforming (T)(x & c) into (T)x & (T)c. Which is exactly the opposite transformation that build_binary_op just performed! Weird...
So I see two options: * Either teach fold_unary to avoid this particular transformation in this particular case. * Hack conversion_warning to realize that (short)((int)x & c) is the same as (short)(x & c) if x is signed int and c fits in a signed int. Which will be undoing the transformation once more (fourth? fifth time?). And I am not even sure how to do this. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34389