tree-opt: Fix bootstrap failure in tree-ssa-forwprop.c some more PR90838
authorJakub Jelinek <jakub@redhat.com>
Mon, 13 Jan 2020 13:14:57 +0000 (14:14 +0100)
committerJakub Jelinek <jakub@redhat.com>
Mon, 13 Jan 2020 13:14:57 +0000 (14:14 +0100)
2020-01-13  Jakub Jelinek  <jakub@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.  Initialize ctzval to avoid
warning at -O0.

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

index a195863212ea94a191c4377c1e4a6704ed278540..f7df07343d1b3e63acf43faae829b3ed14ac9631 100644 (file)
@@ -1,3 +1,12 @@
+2020-01-13  Jakub Jelinek  <jakub@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.  Initialize ctzval to avoid
+       warning at -O0.
+
 2020-01-10  Thomas Schwinge  <thomas@codesourcery.com>
 
        * tree.h (OMP_CLAUSE_USE_DEVICE_PTR_IF_PRESENT): New definition.
index aac31d02b6c294bde5d514977683b52ac7e07c8a..56c470f6ecfe4c0703350e797e50832f323c43d0 100644 (file)
@@ -1920,10 +1920,10 @@ simplify_count_trailing_zeroes (gimple_stmt_iterator *gsi)
                                      res_ops[1], res_ops[2], zero_val))
     {
       tree type = TREE_TYPE (res_ops[0]);
-      HOST_WIDE_INT ctzval;
+      HOST_WIDE_INT ctzval = 0;
       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.  */