public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/110495] fre introduces signed wrap for vector
Date: Mon, 03 Jul 2023 08:09:13 +0000	[thread overview]
Message-ID: <bug-110495-4-o4773ig1Xk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110495-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110495

--- Comment #2 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
The point of the builder is that, if you know the pattern,
you don't need to supply every element value to the builder.
(And indeed you can't when the vector is variable length.)

So something might push:

  { a, b, c, ... }

and leave the other elements implicit.  Same when computing
the result of adding two vectors with the same pattern
(new_binary_operation).  It might be that the overflow
happens in elements that are not encoded.  But something
later could still ask for the value of the fourth or fifth
element and get something that overflows, even if the vector
itself is not marked as overflowing.

E.g. to take chars as an example, we could build:

    { 0x3c, 0x3d, …, 0x43 }
  + { 0x3c, 0x3d, …, 0x43 }

by pushing all 8 elements of each vector, and seeing the
overflow for 0x40+0x40.  We'd then set TREE_OVERFLOW on
the VECTOR_CST.  But we could also just push 0x3c, 0x3d, 0x3e,
add those together, and get the same constant without the
TREE_OVERFLOW.

So I'm not sure that TREE_OVERFLOW on a VECTOR_CST is really meaningful.

  parent reply	other threads:[~2023-07-03  8:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30  9:06 [Bug tree-optimization/110495] New: " kristerw at gcc dot gnu.org
2023-06-30  9:33 ` [Bug middle-end/110495] " rguenth at gcc dot gnu.org
2023-07-03  8:09 ` rsandifo at gcc dot gnu.org [this message]
2023-07-03  8:40 ` rguenth at gcc dot gnu.org
2023-07-03  8:43 ` rguenth at gcc dot gnu.org
2023-07-04  7:08 ` cvs-commit at gcc dot gnu.org
2023-07-04  7:09 ` rguenth at gcc dot gnu.org

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=bug-110495-4-o4773ig1Xk@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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