On GENERIC tcc_comparison can have int type so restrict the PR113126
fix to vector types.
PR middle-end/113344
* match.pd ((double)float CMP (double)float -> float CMP float):
Perform result type check only for vectors.
* fold-const.cc (fold_binary_loc): Likewise.
newtype = TREE_TYPE (targ1);
if (element_precision (newtype) < element_precision (TREE_TYPE (arg0))
- && is_truth_type_for (newtype, type))
+ && (!VECTOR_TYPE_P (type) || is_truth_type_for (newtype, type)))
return fold_build2_loc (loc, code, type,
fold_convert_loc (loc, newtype, targ0),
fold_convert_loc (loc, newtype, targ1));
? TREE_TYPE (@00) : type1);
}
(if (element_precision (TREE_TYPE (@0)) > element_precision (newtype)
- && is_truth_type_for (newtype, type))
+ && (!VECTOR_TYPE_P (type) || is_truth_type_for (newtype, type)))
(cmp (convert:newtype @00) (convert:newtype @10))))))))