https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103228

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Possibly some STRIP_NOPS gone "missing" during fold-const.c -> match.pd move
> of some patterns.

Well match.pd has:
/* Try to fold (type) X op CST -> (type) (X op ((type-x) CST))
   when profitable.
   For bitwise binary operations apply operand conversions to the
   binary operation result instead of to the operands.  This allows
   to combine successive conversions and bitwise binary operations.
   We combine the above two cases by using a conditional convert.  */

Just the check for precision was < and not <= :
       && (/* That's a good idea if the conversion widens the operand, thus
              after hoisting the conversion the operation will be narrower.  */
           TYPE_PRECISION (TREE_TYPE (@0)) < TYPE_PRECISION (type)

I am going to test changing < to <=.
Note the atomic changed (PR 103194) might have some conflict with this.

Reply via email to