]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/90838 (Detect table-based ctz implementation)
authorJakub Jelinek <jakub@redhat.com>
Fri, 10 Jan 2020 21:10:03 +0000 (22:10 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Jan 2020 21:10:03 +0000 (22:10 +0100)
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

gcc/ChangeLog
gcc/tree-ssa-forwprop.c

index 24b5c971e5e723abc4127428d4d2459753f53e97..5471c9f40415bbef15bee52b85ef4c269a5f3041 100644 (file)
@@ -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
index aced6eb2d9139cae277593022415bc5efdf45175..aac31d02b6c294bde5d514977683b52ac7e07c8a 100644 (file)
@@ -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.  */