aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-06-23 10:06:08 +0200
committerRichard Biener <rguenther@suse.de>2023-06-26 13:02:35 +0200
commitc3bdee86183b3d84f269e9775b2603f8f8221417 (patch)
tree5054c5a76100dbc873070cdc308556bba2ff0167
parent9f76f04be40adffb2d3498010a23051502031140 (diff)
downloadgcc-c3bdee86183b3d84f269e9775b2603f8f8221417.zip
gcc-c3bdee86183b3d84f269e9775b2603f8f8221417.tar.gz
gcc-c3bdee86183b3d84f269e9775b2603f8f8221417.tar.bz2
Fix TYPE_PRECISION use in hashable_expr_equal_p
While the checks look unnecessary they probably are quick and thus done early. The following avoids using TYPE_PRECISION on VECTOR_TYPEs by making the code match the comment which talks about precision and signedness. An alternative would be to only retain the ERROR_MARK and TYPE_MODE checks or use TYPE_PRECISION_RAW (but I like that least). * tree-ssa-scopedtables.cc (hashable_expr_equal_p): Use element_precision.
-rw-r--r--gcc/tree-ssa-scopedtables.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-scopedtables.cc b/gcc/tree-ssa-scopedtables.cc
index 528ddf2..e698ef9 100644
--- a/gcc/tree-ssa-scopedtables.cc
+++ b/gcc/tree-ssa-scopedtables.cc
@@ -574,7 +574,7 @@ hashable_expr_equal_p (const struct hashable_expr *expr0,
&& (TREE_CODE (type0) == ERROR_MARK
|| TREE_CODE (type1) == ERROR_MARK
|| TYPE_UNSIGNED (type0) != TYPE_UNSIGNED (type1)
- || TYPE_PRECISION (type0) != TYPE_PRECISION (type1)
+ || element_precision (type0) != element_precision (type1)
|| TYPE_MODE (type0) != TYPE_MODE (type1)))
return false;