Re: [committed] Unbreak bootstrap on most targets (was Re: [PATCH] PR90838: Support ctz idioms)

2020-01-11 Thread Jakub Jelinek
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  

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



Re: [committed] Unbreak bootstrap on most targets (was Re: [PATCH] PR90838: Support ctz idioms)

2020-01-11 Thread Andreas Schwab
../../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);
  |   ^~~~

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."