aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-06-23 10:01:38 +0200
committerRichard Biener <rguenther@suse.de>2023-06-26 13:02:35 +0200
commit5b3d421be747386349981c6291f0af1756b1112c (patch)
tree78f334048be3fdf3afc1c691d8a1d00d6ccbf1b7 /gcc
parentc3bdee86183b3d84f269e9775b2603f8f8221417 (diff)
downloadgcc-5b3d421be747386349981c6291f0af1756b1112c.zip
gcc-5b3d421be747386349981c6291f0af1756b1112c.tar.gz
gcc-5b3d421be747386349981c6291f0af1756b1112c.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/c-common.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index 9c8eed5..34566a3 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