diff options
author | Richard Biener <rguenther@suse.de> | 2023-06-09 09:29:09 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-06-09 11:07:08 +0200 |
commit | 3e12669a0eb968cfcbe9242b382fd8020935edf8 (patch) | |
tree | c0aaf7ed70da0066ef3e904128513979f75c4274 /gcc | |
parent | 3ec1d76a359542ed4c8370390efa9ee9e25e757f (diff) | |
download | gcc-3e12669a0eb968cfcbe9242b382fd8020935edf8.zip gcc-3e12669a0eb968cfcbe9242b382fd8020935edf8.tar.gz gcc-3e12669a0eb968cfcbe9242b382fd8020935edf8.tar.bz2 |
middle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code
When folding two conversions in a row we use TYPE_PRECISION but
that's invalid for VECTOR_TYPE. The following fixes this by
using element_precision instead.
* match.pd (two conversions in a row): Use element_precision
to DTRT for VECTOR_TYPE.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/match.pd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 4ad037d..4072afb 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -4147,19 +4147,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) int inside_ptr = POINTER_TYPE_P (inside_type); int inside_float = FLOAT_TYPE_P (inside_type); int inside_vec = VECTOR_TYPE_P (inside_type); - unsigned int inside_prec = TYPE_PRECISION (inside_type); + unsigned int inside_prec = element_precision (inside_type); int inside_unsignedp = TYPE_UNSIGNED (inside_type); int inter_int = INTEGRAL_TYPE_P (inter_type); int inter_ptr = POINTER_TYPE_P (inter_type); int inter_float = FLOAT_TYPE_P (inter_type); int inter_vec = VECTOR_TYPE_P (inter_type); - unsigned int inter_prec = TYPE_PRECISION (inter_type); + unsigned int inter_prec = element_precision (inter_type); int inter_unsignedp = TYPE_UNSIGNED (inter_type); int final_int = INTEGRAL_TYPE_P (type); int final_ptr = POINTER_TYPE_P (type); int final_float = FLOAT_TYPE_P (type); int final_vec = VECTOR_TYPE_P (type); - unsigned int final_prec = TYPE_PRECISION (type); + unsigned int final_prec = element_precision (type); int final_unsignedp = TYPE_UNSIGNED (type); } (switch |