public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2092] Avoid shorten_binary_op on VECTOR_TYPE
@ 2023-06-26 11:05 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-06-26 11:05 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:5b3d421be747386349981c6291f0af1756b1112c
commit r14-2092-g5b3d421be747386349981c6291f0af1756b1112c
Author: Richard Biener <rguenther@suse.de>
Date: Fri Jun 23 10:01:38 2023 +0200
Avoid shorten_binary_op on VECTOR_TYPE
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.
gcc/c-family/
* c-common.cc (shorten_binary_op): Exit early for VECTOR_TYPE
operations.
Diff:
---
gcc/c-family/c-common.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index 9c8eed5442a..34566a342bd 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-26 11:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26 11:05 [gcc r14-2092] Avoid shorten_binary_op on VECTOR_TYPE Richard Biener
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).