Message ID | 20230623082735.8C7AF1331F@imap2.suse-dmz.suse.de |
---|---|
State | New |
Headers | show |
Series | [1/6] Avoid shorten_binary_op on VECTOR_TYPE | expand |
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 3aa6851acd5..7e35eda7140 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -14530,7 +14530,8 @@ tree_expr_maybe_real_minus_zero_p (const_tree x) static bool tree_simple_nonnegative_warnv_p (enum tree_code code, tree type) { - if ((TYPE_PRECISION (type) != 1 || TYPE_UNSIGNED (type)) + if (!VECTOR_TYPE_P (type) + && (TYPE_PRECISION (type) != 1 || TYPE_UNSIGNED (type)) && truth_value_p (code)) /* Truth values evaluate to 0 or 1, which is nonnegative unless we have a signed:1 type (where the value is -1 and 0). */