public inbox for
 help / color / mirror / Atom feed
From: Richard Biener <>
Subject: [PATCH 1/6] Avoid shorten_binary_op on VECTOR_TYPE
Date: Fri, 23 Jun 2023 10:26:41 +0200 (CEST)	[thread overview]
Message-ID: <> (raw)

When we disallow TYPE_PRECISION on VECTOR_TYPEs it shows that
shorten_binary_op performs some checks on that that are likely
harmless in the end.  The following bails out early for
VECTOR_TYPE operations to avoid those questionable checks.

Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu.


	* (shorten_binary_op): Exit early for VECTOR_TYPE
 gcc/c-family/ | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/c-family/ b/gcc/c-family/
index 9c8eed5442a..34566a342bd 100644
--- a/gcc/c-family/
+++ b/gcc/c-family/
@@ -1338,6 +1338,10 @@ shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise)
   int uns;
   tree type;
+  /* Do not shorten vector operations.  */
+  if (VECTOR_TYPE_P (result_type))
+    return result_type;
   /* Cast OP0 and OP1 to RESULT_TYPE.  Doing so prevents
      excessive narrowing when we call get_narrower below.  For
      example, suppose that OP0 is of unsigned int extended

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23  8:26 Richard Biener [this message]
2023-06-23 14:50 ` Jeff Law

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).