Remove another bunch of dead assignment.
authorMartin Liska <mliska@suse.cz>
Wed, 3 Jul 2019 08:34:20 +0000 (10:34 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 3 Jul 2019 08:34:20 +0000 (08:34 +0000)
2019-07-03  Martin Liska  <mliska@suse.cz>

* lra-eliminations.c (eliminate_regs_in_insn): Remove
dead assignemts.
* reg-stack.c (check_asm_stack_operands): Likewise.
* tree-ssa-structalias.c (create_function_info_for): Likewise.
* tree-vect-generic.c (expand_vector_operations_1): Likewise.
* config/i386/i386-expand.c (ix86_expand_sse2_mulvxdi3): Use
force_expand_binop.
2019-07-03  Martin Liska  <mliska@suse.cz>

* c-common.c (try_to_locate_new_include_insertion_point): Remove
dead assignemts.
2019-07-03  Martin Liska  <mliska@suse.cz>

* call.c (build_new_op_1): Remove
dead assignemts.
* typeck.c (cp_build_binary_op): Likewise.
2019-07-03  Martin Liska  <mliska@suse.cz>

* check.c (gfc_check_c_funloc): Remove
dead assignemts.
* decl.c (variable_decl): Likewise.
* resolve.c (resolve_typebound_function): Likewise.
* simplify.c (gfc_simplify_matmul): Likewise.
(gfc_simplify_scan): Likewise.
* trans-array.c (gfc_could_be_alias): Likewise.
* trans-common.c (add_equivalences): Likewise.
* trans-expr.c (trans_class_vptr_len_assignment): Likewise.
(gfc_trans_array_constructor_copy): Likewise.
(gfc_trans_assignment_1): Likewise.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Likewise.
* trans-openmp.c (gfc_omp_finish_clause): Likewise.
* trans-types.c (gfc_get_array_descriptor_base): Likewise.
* trans.c (gfc_build_final_call): Likewise.
2019-07-03  Martin Liska  <mliska@suse.cz>

* line-map.c (linemap_get_expansion_filename): Remove
dead assignemts.
* mkdeps.c (make_write): Likewise.

From-SVN: r272994

26 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/config/i386/i386-expand.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/typeck.c
gcc/fortran/ChangeLog
gcc/fortran/check.c
gcc/fortran/decl.c
gcc/fortran/resolve.c
gcc/fortran/simplify.c
gcc/fortran/trans-array.c
gcc/fortran/trans-common.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-intrinsic.c
gcc/fortran/trans-openmp.c
gcc/fortran/trans-types.c
gcc/fortran/trans.c
gcc/lra-eliminations.c
gcc/reg-stack.c
gcc/tree-ssa-structalias.c
gcc/tree-vect-generic.c
libcpp/ChangeLog
libcpp/line-map.c
libcpp/mkdeps.c

index a1d7c5bedd72f3e7205ae7450a19dbefc6f49177..b76b213ce18a2ca868ab84e1b23e1d3e3420cb0f 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-03  Martin Liska  <mliska@suse.cz>
+
+       * lra-eliminations.c (eliminate_regs_in_insn): Remove
+       dead assignemts.
+       * reg-stack.c (check_asm_stack_operands): Likewise.
+       * tree-ssa-structalias.c (create_function_info_for): Likewise.
+       * tree-vect-generic.c (expand_vector_operations_1): Likewise.
+       * config/i386/i386-expand.c (ix86_expand_sse2_mulvxdi3): Use
+       force_expand_binop.
+
 2019-07-03  Martin Liska  <mliska@suse.cz>
 
        PR tree-optimization/90892
index 3907d3a5fffa3dd6a2abfd2a18c6c699a6b3905b..84d1f2e4f1d14a3c35c1c046180baaaadd267592 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-03  Martin Liska  <mliska@suse.cz>
+
+       * c-common.c (try_to_locate_new_include_insertion_point): Remove
+       dead assignemts.
+
 2019-07-03  Jakub Jelinek  <jakub@redhat.com>
 
        * c-omp.c (c_omp_split_clauses): Put OMP_CLAUSE_REDUCTION_INSCAN
index da4aadbc59060ccfc2836acd90640dfe6e91fef3..cb92710f2bc62e894592fac84cfc8f04d7e15fd7 100644 (file)
@@ -8601,8 +8601,8 @@ try_to_locate_new_include_insertion_point (const char *file, location_t loc)
 
   /*  Get ordinary map containing LOC (or its expansion).  */
   const line_map_ordinary *ord_map_for_loc = NULL;
-  loc = linemap_resolve_location (line_table, loc, LRK_MACRO_EXPANSION_POINT,
-                                 &ord_map_for_loc);
+  linemap_resolve_location (line_table, loc, LRK_MACRO_EXPANSION_POINT,
+                           &ord_map_for_loc);
   gcc_assert (ord_map_for_loc);
 
   for (unsigned int i = 0; i < LINEMAPS_ORDINARY_USED (line_table); i++)
index 85d74a28636ebcbeea60e14f82bf6f61399b2409..5d3b74a159fdcdb49b6f4189d100ba28b513f845 100644 (file)
@@ -19779,8 +19779,7 @@ ix86_expand_sse2_mulvxdi3 (rtx op0, rtx op1, rtx op2)
       emit_insn (gen_vec_widen_umult_even_v4si (t5, 
                                        gen_lowpart (V4SImode, op1),
                                        gen_lowpart (V4SImode, op2)));
-      op0 = expand_binop (mode, add_optab, t5, t4, op0, 1, OPTAB_DIRECT);
-
+      force_expand_binop (mode, add_optab, t5, t4, op0, 1, OPTAB_DIRECT);
     }
   else
     {
index db7ddf5075703b4b490bc55ff96b37ce45e8dbb0..7031d8d66bf8ddf75a322d386e018b77874a6d73 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-03  Martin Liska  <mliska@suse.cz>
+
+       * call.c (build_new_op_1): Remove
+       dead assignemts.
+       * typeck.c (cp_build_binary_op): Likewise.
+
 2019-06-27  Jason Merrill  <jason@redhat.com>
 
        PR c++/55442 - memory-hog with highly recursive constexpr.
index e4923f4ccbfde3a84f78a71cb26ae1166975c0da..0709325550568ff30615a8d9f72305abe8bcea8c 100644 (file)
@@ -6167,7 +6167,7 @@ build_new_op_1 (const op_location_t &loc, enum tree_code code, int flags,
              conv = cand->convs[2];
              if (conv->kind == ck_ref_bind)
                conv = next_conversion (conv);
-             arg3 = convert_like (conv, arg3, complain);
+             convert_like (conv, arg3, complain);
            }
 
        }
index dd76ebe3dbfc546dc2a09825b2f8d48097cd7a50..77095953134838120ced894c20fe8d63e94b7e90 100644 (file)
@@ -5218,7 +5218,6 @@ cp_build_binary_op (const op_location_t &location,
            }
          result_type = build_opaque_vector_type (intt,
                                                  TYPE_VECTOR_SUBPARTS (type0));
-         converted = 1;
          return build_vec_cmp (resultcode, result_type, op0, op1);
        }
       build_type = boolean_type_node;
index 699b072de1c0b2412a4a221d49eb76c9a2af27ac..a163a1d79198715f1f3888cffa5cbbc01a769828 100644 (file)
@@ -1,3 +1,21 @@
+2019-07-03  Martin Liska  <mliska@suse.cz>
+
+       * check.c (gfc_check_c_funloc): Remove
+       dead assignemts.
+       * decl.c (variable_decl): Likewise.
+       * resolve.c (resolve_typebound_function): Likewise.
+       * simplify.c (gfc_simplify_matmul): Likewise.
+       (gfc_simplify_scan): Likewise.
+       * trans-array.c (gfc_could_be_alias): Likewise.
+       * trans-common.c (add_equivalences): Likewise.
+       * trans-expr.c (trans_class_vptr_len_assignment): Likewise.
+       (gfc_trans_array_constructor_copy): Likewise.
+       (gfc_trans_assignment_1): Likewise.
+       * trans-intrinsic.c (conv_intrinsic_atomic_op): Likewise.
+       * trans-openmp.c (gfc_omp_finish_clause): Likewise.
+       * trans-types.c (gfc_get_array_descriptor_base): Likewise.
+       * trans.c (gfc_build_final_call): Likewise.
+
 2019-06-27  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/90987
index a04f0d66655cd51ba34671cfe83906d281b6bae2..9580180402247784d433bfa5164818f401867c34 100644 (file)
@@ -4884,17 +4884,13 @@ gfc_check_c_funloc (gfc_expr *x)
 
   if (attr.function && !attr.proc_pointer && x->expr_type == EXPR_VARIABLE
       && x->symtree->n.sym == x->symtree->n.sym->result)
-    {
-      gfc_namespace *ns = gfc_current_ns;
-
-      for (ns = gfc_current_ns; ns; ns = ns->parent)
-       if (x->symtree->n.sym == ns->proc_name)
-         {
-           gfc_error ("Function result %qs at %L is invalid as X argument "
-                      "to C_FUNLOC", x->symtree->n.sym->name, &x->where);
-           return false;
-         }
-    }
+    for (gfc_namespace *ns = gfc_current_ns; ns; ns = ns->parent)
+      if (x->symtree->n.sym == ns->proc_name)
+       {
+         gfc_error ("Function result %qs at %L is invalid as X argument "
+                    "to C_FUNLOC", x->symtree->n.sym->name, &x->where);
+         return false;
+       }
 
   if (attr.flavor != FL_PROCEDURE)
     {
index 7e4e8a29984077b0e0873dae922f15aa8099defc..3d29091282e457c86eb145b4de18c2ef3940e5a2 100644 (file)
@@ -2455,7 +2455,6 @@ variable_decl (int elem)
 
       /* %FILL components are given invalid fortran names.  */
       snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "%%FILL%u", fill_id++);
-      m = MATCH_YES;
     }
 
   var_locus = gfc_current_locus;
index af7078a46d90be818a0a8d37f7794c9d4d043752..c82e8f21341a408bacca6e6738a798a84f689185 100644 (file)
@@ -6573,7 +6573,6 @@ resolve_typebound_function (gfc_expr* e)
     }
 
   c = gfc_find_component (declared, "_data", true, true, NULL);
-  declared = c->ts.u.derived;
 
   /* Treat the call as if it is a typebound procedure, in order to roll
      out the correct name for the specific function.  */
index 6c1f4bd4fce300c24b673925906f2bb0f0acc26c..2d20913ca560974d1edb7820f8c91afbb4c5d3c7 100644 (file)
@@ -4714,7 +4714,7 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
   else
     gcc_unreachable();
 
-  offset_a = offset_b = 0;
+  offset_b = 0;
   for (col = 0; col < result_columns; ++col)
     {
       offset_a = 0;
@@ -6999,20 +6999,17 @@ gfc_simplify_scan (gfc_expr *e, gfc_expr *c, gfc_expr *b, gfc_expr *kind)
            indx = 0;
        }
       else
-       {
-         i = 0;
-         for (indx = len; indx > 0; indx--)
-           {
-             for (i = 0; i < lenc; i++)
-               {
-                 if (c->value.character.string[i]
-                     == e->value.character.string[indx - 1])
-                   break;
-               }
-             if (i < lenc)
-               break;
-           }
-       }
+       for (indx = len; indx > 0; indx--)
+         {
+           for (i = 0; i < lenc; i++)
+             {
+               if (c->value.character.string[i]
+                   == e->value.character.string[indx - 1])
+                 break;
+             }
+           if (i < lenc)
+             break;
+         }
     }
 
   result = gfc_get_int_expr (k, &e->where, indx);
index 56d534d04442f0f8b9217bd10e8dd0e23f0d270c..1ab03615fda0a6a9e93d3ffe029a2a8eddb14767 100644 (file)
@@ -4794,8 +4794,6 @@ gfc_could_be_alias (gfc_ss * lss, gfc_ss * rss)
 
   lsym_pointer = lsym->attr.pointer;
   lsym_target = lsym->attr.target;
-  lsym_pointer = lsym->attr.pointer;
-  lsym_target = lsym->attr.target;
 
   for (rref = rexpr->ref; rref != rss->info->data.array.ref; rref = rref->next)
     {
index debdbd98ac0820b927d2d4a43df4de88a25b4d1f..9fc23ff5e7c7d2122c3bf50338424845e31e4bb2 100644 (file)
@@ -1007,10 +1007,8 @@ static void
 add_equivalences (bool *saw_equiv)
 {
   segment_info *f;
-  bool seen_one, more;
+  bool more = TRUE;
 
-  seen_one = false;
-  more = TRUE;
   while (more)
     {
       more = FALSE;
@@ -1019,7 +1017,7 @@ add_equivalences (bool *saw_equiv)
          if (!f->sym->equiv_built)
            {
              f->sym->equiv_built = 1;
-             seen_one = find_equivalence (f);
+             bool seen_one = find_equivalence (f);
              if (seen_one)
                {
                  *saw_equiv = true;
index 074568ab596d181b10bc16fd753e20d94b312d31..a4e8351110ac247f77d213f2cc76ea00eb75206a 100644 (file)
@@ -8912,7 +8912,6 @@ trans_class_vptr_len_assignment (stmtblock_t *block, gfc_expr * le,
                from_len = rse->string_length;
              else if (re->ts.type == BT_CHARACTER && re->ts.u.cl->length)
                {
-                 from_len = gfc_get_expr_charlen (re);
                  gfc_init_se (&se, NULL);
                  gfc_conv_expr (&se, re->ts.u.cl->length);
                  gfc_add_block_to_block (block, &se.pre);
@@ -10171,10 +10170,6 @@ gfc_trans_array_constructor_copy (gfc_expr * expr1, gfc_expr * expr2)
   stype = gfc_typenode_for_spec (&expr2->ts);
   src = gfc_build_constant_array_constructor (expr2, stype);
 
-  stype = TREE_TYPE (src);
-  if (POINTER_TYPE_P (stype))
-    stype = TREE_TYPE (stype);
-
   return gfc_build_memcpy_call (dst, src, len);
 }
 
@@ -10924,7 +10919,6 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
                       && (gfc_is_class_array_function (expr2)
                           || gfc_is_alloc_class_scalar_function (expr2)))
     {
-      tmp = rse.expr;
       tmp = gfc_nullify_alloc_comp (expr1->ts.u.derived, rse.expr, 0);
       gfc_prepend_expr_to_block (&rse.post, tmp);
       if (lss != gfc_ss_terminator && rss == gfc_ss_terminator)
index cc041f9eea706ecd5a5e917b1f790daac268b798..a7ebc413d6ec4b82717146acbb3230fd3b6f03f7 100644 (file)
@@ -10971,7 +10971,6 @@ conv_intrinsic_atomic_op (gfc_code *code)
   fn = (built_in_function) ((int) fn
                            + exact_log2 (tree_to_uhwi (TYPE_SIZE_UNIT (tmp)))
                            + 1);
-  tmp = builtin_decl_explicit (fn);
   tree itype = TREE_TYPE (TREE_TYPE (atom));
   tmp = builtin_decl_explicit (fn);
 
index 394cbc2a929a8ee9cde0620de2584fe5051a8ba6..8eae7bc0a520dfee22797540c80659d560602a75 100644 (file)
@@ -1199,7 +1199,6 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p)
     {
       OMP_CLAUSE_CHAIN (c4) = OMP_CLAUSE_CHAIN (last);
       OMP_CLAUSE_CHAIN (last) = c4;
-      last = c4;
     }
 }
 
index 1dbb842a1c417906e5f9b961e85eeb84beea2a32..e1033b3b223bee3cd3184122e23658ce57a58ca0 100644 (file)
@@ -1817,11 +1817,11 @@ gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted)
   TYPE_NAMELESS (fat_type) = 1;
 
   /* Add the data member as the first element of the descriptor.  */
-  decl = gfc_add_field_to_struct_1 (fat_type,
-                                   get_identifier ("data"),
-                                   (restricted
-                                    ? prvoid_type_node
-                                    : ptr_type_node), &chain);
+  gfc_add_field_to_struct_1 (fat_type,
+                            get_identifier ("data"),
+                            (restricted
+                             ? prvoid_type_node
+                             : ptr_type_node), &chain);
 
   /* Add the base component.  */
   decl = gfc_add_field_to_struct_1 (fat_type,
index 0d786d9cf99f5d83fbf99362305d7cd89ef4a372..303abd994c5812b1d8e02e8db83b105107d8597f 100644 (file)
@@ -1014,9 +1014,6 @@ gfc_build_final_call (gfc_typespec ts, gfc_expr *final_wrapper, gfc_expr *var,
          gfc_add_block_to_block (&block, &se.pre);
          gcc_assert (se.post.head == NULL_TREE);
          array = se.expr;
-         if (TREE_CODE (array) == ADDR_EXPR
-             && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (array, 0))))
-           tmp = TREE_OPERAND (array, 0);
 
          if (!gfc_is_coarray (array_expr))
            {
index f344e127cfeeb9490ea502f05e57a8926be38b00..051839a2717663e44d0e177aed2ea1819dfc2498 100644 (file)
@@ -1053,7 +1053,7 @@ eliminate_regs_in_insn (rtx_insn *insn, bool replace_p, bool first_p,
      PARALLEL since the new one still will, but we can't call
      single_set without having put new body into the insn and the
      re-recognition won't hurt in this rare case.  */
-  id = lra_update_insn_recog_data (insn);
+  lra_update_insn_recog_data (insn);
 }
 
 /* Spill pseudos which are assigned to hard registers in SET.  Add
index 8c934aaf936e945a30e46d34106f3eeafd155544..5576630c8f25f96dc83fa2a5bd19cbe3ce51c75e 100644 (file)
@@ -484,7 +484,6 @@ check_asm_stack_operands (rtx_insn *insn)
 
   if (which_alternative < 0)
     {
-      malformed_asm = 1;
       /* Avoid further trouble with this insn.  */
       PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
       return 0;
index 07791519c6cff0a395ee8b5267f201fde2230868..29688d2618d41efe54d3c8c2720b730dde22e377 100644 (file)
@@ -5955,7 +5955,6 @@ create_function_info_for (tree decl, const char *name, bool add_id,
 
       gcc_assert (prev_vi->offset < argvi->offset);
       prev_vi->next = argvi->id;
-      prev_vi = argvi;
     }
 
   return vi;
index 4a53fc44584cc180a958eb3f9434eff14236499b..8389f5555e81cfab32b3a8e239379bf982d47fc0 100644 (file)
@@ -1981,7 +1981,6 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
       || code == VEC_UNPACK_FLOAT_LO_EXPR
       || code == VEC_PACK_FLOAT_EXPR)
     {
-      type = TREE_TYPE (rhs1);
       /* We do not know how to scalarize those.  */
       return;
     }
@@ -2004,7 +2003,6 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
       || code == VEC_WIDEN_LSHIFT_HI_EXPR
       || code == VEC_WIDEN_LSHIFT_LO_EXPR)
     {
-      type = TREE_TYPE (rhs1);
       /* We do not know how to scalarize those.  */
       return;
     }
index a3185e3109c459a1be2b38ab9f8b5e8e98f4e8dc..ff5f0aa8e06ca3656be5814232ca0c38e44c2f73 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-03  Martin Liska  <mliska@suse.cz>
+
+       * line-map.c (linemap_get_expansion_filename): Remove
+       dead assignemts.
+       * mkdeps.c (make_write): Likewise.
+
 2019-07-02  qing zhao  <qing.zhao@oracle.com>
 
        PR preprocessor/90581
index 31439f4aba3d56ce491d470f1ba1a95ecf4f4786..8ab873b4e184043f13adbf1393a6c8217df34d7d 100644 (file)
@@ -1160,8 +1160,7 @@ linemap_get_expansion_filename (struct line_maps *set,
   if (location < RESERVED_LOCATION_COUNT)
     return NULL;
 
-  location =
-    linemap_macro_loc_to_exp_point (set, location, &map);
+  linemap_macro_loc_to_exp_point (set, location, &map);
 
   return LINEMAP_FILE (map);
 }
index 676ae122bde88685e5e61454fb1289554d2a6d54..50f0fb2a80dc12847e400e07bed40c81430e399d 100644 (file)
@@ -378,7 +378,7 @@ make_write (const struct mkdeps *d, FILE *fp, bool phony, unsigned int colmax)
       column = make_write_vec (d->targets, fp, 0, colmax, d->quote_lwm);
       fputs (":", fp);
       column++;
-      column = make_write_vec (d->deps, fp, column, colmax);
+      make_write_vec (d->deps, fp, column, colmax);
       fputs ("\n", fp);
       if (phony)
        for (unsigned i = 1; i < d->deps.size (); i++)