On Sat, Jan 11, 2020 at 05:24:19PM +0100, Andreas Schwab wrote:
> ../../gcc/tree-ssa-forwprop.c: In function 'bool 
> simplify_count_trailing_zeroes(gimple_stmt_iterator*)':
> ../../gcc/tree-ssa-forwprop.c:1925:23: error: variable 'mode' set but not 
> used [-Werror=unused-but-set-variable]
>  1925 |       scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type);
>       |                       ^~~~

Oops, then I think we need following, but can't commit it until Monday.

2020-01-11  Jakub Jelinek  <ja...@redhat.com>

        PR tree-optimization/90838
        * tree-ssa-forwprop.c (simplify_count_trailing_zeroes): Use
        SCALAR_INT_TYPE_MODE directly in CTZ_DEFINED_VALUE_AT_ZERO macro
        argument rather than to initialize temporary for targets that
        don't use the mode argument at all.

--- gcc/tree-ssa-forwprop.c.jj  2020-01-11 16:31:56.278274863 +0100
+++ gcc/tree-ssa-forwprop.c     2020-01-11 17:27:55.336925656 +0100
@@ -1922,8 +1922,8 @@ simplify_count_trailing_zeroes (gimple_s
       tree type = TREE_TYPE (res_ops[0]);
       HOST_WIDE_INT ctzval;
       HOST_WIDE_INT type_size = tree_to_shwi (TYPE_SIZE (type));
-      scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type);
-      bool zero_ok = CTZ_DEFINED_VALUE_AT_ZERO (mode, ctzval) == 2;
+      bool zero_ok
+       = CTZ_DEFINED_VALUE_AT_ZERO (SCALAR_INT_TYPE_MODE (type), ctzval) == 2;
 
       /* Skip if there is no value defined at zero, or if we can't easily
         return the correct value for zero.  */


        Jakub

Reply via email to