public inbox for
 help / color / mirror / Atom feed
From: Richard Biener <>
Subject: [PATCH 4/6] Fix tree_simple_nonnegative_warnv_p for VECTOR_TYPEs
Date: Fri, 23 Jun 2023 10:27:35 +0200 (CEST)	[thread overview]
Message-ID: <> (raw)

tree_simple_nonnegative_warnv_p ends up being called on VECTOR_TYPEs
which I think even gets the wrong answer here for tcc_comparison
since vector bools are signed.  The following properly guards
that with !VECTOR_TYPE_P.

Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu, will
push after that finished.

	* (tree_simple_nonnegative_warnv_p): Guard
	the truth_value_p case with !VECTOR_TYPE_P.
 gcc/ | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ b/gcc/
index 3aa6851acd5..7e35eda7140 100644
--- a/gcc/
+++ b/gcc/
@@ -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).  */

                 reply	other threads:[~2023-06-23  8:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).