aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-01-10 22:10:03 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2020-01-10 22:10:03 +0100
commit974bb8a4dcbf51a153ab72da91a7256a296e7fa1 (patch)
treedb1729b6b79ee66541b02773d9485c61b8a624ce /gcc
parenta29a9962ea060951c35b301a1cf708aa65ffc582 (diff)
downloadgcc-974bb8a4dcbf51a153ab72da91a7256a296e7fa1.zip
gcc-974bb8a4dcbf51a153ab72da91a7256a296e7fa1.tar.gz
gcc-974bb8a4dcbf51a153ab72da91a7256a296e7fa1.tar.bz2
re PR tree-optimization/90838 (Detect table-based ctz implementation)
PR tree-optimization/90838 * tree-ssa-forwprop.c (simplify_count_trailing_zeroes): Use SCALAR_INT_TYPE_MODE instead of TYPE_MODE as operand of CTZ_DEFINED_VALUE_AT_ZERO. From-SVN: r280140
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-ssa-forwprop.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24b5c97..5471c9f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/90838
+ * tree-ssa-forwprop.c (simplify_count_trailing_zeroes): Use
+ SCALAR_INT_TYPE_MODE instead of TYPE_MODE as operand of
+ CTZ_DEFINED_VALUE_AT_ZERO.
+
2020-01-10 Vladimir Makarov <vmakarov@redhat.com>
PR inline-asm/93027
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index aced6eb..aac31d0 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1922,7 +1922,8 @@ simplify_count_trailing_zeroes (gimple_stmt_iterator *gsi)
tree type = TREE_TYPE (res_ops[0]);
HOST_WIDE_INT ctzval;
HOST_WIDE_INT type_size = tree_to_shwi (TYPE_SIZE (type));
- bool zero_ok = CTZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (type), ctzval) == 2;
+ scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type);
+ bool zero_ok = CTZ_DEFINED_VALUE_AT_ZERO (mode, ctzval) == 2;
/* Skip if there is no value defined at zero, or if we can't easily
return the correct value for zero. */