after hoisting the conversion the operation will be narrower.
It is also a good if the conversion is a nop as moves the
conversion to one side; allowing for combining of the conversions. */
- TYPE_PRECISION (TREE_TYPE (@0)) <= TYPE_PRECISION (type)
+ TYPE_PRECISION (TREE_TYPE (@0)) < TYPE_PRECISION (type)
+ /* The conversion check for being a nop can only be done at the gimple
+ level as fold_binary has some re-association code which can conflict
+ with this if there is a "constant" which is not a full INTEGER_CST. */
+ || (GIMPLE && TYPE_PRECISION (TREE_TYPE (@0)) == TYPE_PRECISION (type))
/* It's also a good idea if the conversion is to a non-integer
mode. */
|| GET_MODE_CLASS (TYPE_MODE (type)) != MODE_INT