]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove loop-incremented dead code.
authorMartin Liska <mliska@suse.cz>
Tue, 12 Apr 2022 13:06:40 +0000 (15:06 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 5 May 2022 13:03:47 +0000 (15:03 +0200)
gcc/ChangeLog:

* genautomata.cc (create_composed_state): Remove dead code.
* graphite-poly.cc (print_pdrs): Likewise.
* lto-wrapper.cc (run_gcc): Likewise.
* tree-switch-conversion.cc (switch_decision_tree::balance_case_nodes):
Likewise.

gcc/genautomata.cc
gcc/graphite-poly.cc
gcc/lto-wrapper.cc
gcc/tree-switch-conversion.cc

index e43314e4ea31313bba2c934e94df0653af07a221..389c1c3e0ed7534ec5db0478d72d63da449eb657 100644 (file)
@@ -5661,7 +5661,6 @@ create_composed_state (state_t original_state, arc_t arcs_marked_by_insn,
   state_t state_in_table;
   state_t temp_state;
   alt_state_t canonical_alt_states_list;
-  int alts_number;
   int new_state_p = 0;
 
   if (arcs_marked_by_insn == NULL)
@@ -5731,17 +5730,15 @@ create_composed_state (state_t original_state, arc_t arcs_marked_by_insn,
                      || (curr_arc->insn->insn_reserv_decl
                          != DECL_INSN_RESERV (advance_cycle_insn_decl)))
                    add_arc (state, curr_arc->to_state, curr_arc->insn);
-            }
-          arcs_marked_by_insn->to_state = state;
-          for (alts_number = 0,
-              curr_arc = arcs_marked_by_insn->next_arc_marked_by_insn;
-               curr_arc != NULL;
-               curr_arc = next_arc)
-            {
-              next_arc = curr_arc->next_arc_marked_by_insn;
-              remove_arc (original_state, curr_arc);
-             alts_number++;
-            }
+           }
+         arcs_marked_by_insn->to_state = state;
+         for (curr_arc = arcs_marked_by_insn->next_arc_marked_by_insn;
+              curr_arc != NULL;
+              curr_arc = next_arc)
+           {
+             next_arc = curr_arc->next_arc_marked_by_insn;
+             remove_arc (original_state, curr_arc);
+           }
         }
     }
   if (!state->it_was_placed_in_stack_for_DFA_forming)
index 42ed038768e91f0feced85b398f8dd08a691bcd9..173aae074424c151917081d78dadfb000e393a08 100644 (file)
@@ -341,20 +341,10 @@ dump_gbb_conditions (FILE *file, gimple_poly_bb_p gbb)
 void
 print_pdrs (FILE *file, poly_bb_p pbb)
 {
-  int nb_reads = 0;
-  int nb_writes = 0;
-
   if (PBB_DRS (pbb).is_empty ())
     return;
 
   fprintf (file, "Data references (\n");
-
-  for (poly_dr_p pdr : PBB_DRS (pbb))
-    if (PDR_TYPE (pdr) == PDR_READ)
-      nb_reads++;
-    else
-      nb_writes++;
-
   fprintf (file, "Read data references (\n");
 
   for (poly_dr_p pdr : PBB_DRS (pbb))
index 285e6e96af50709edd08f26ff8605092b95101a7..26e06e77be4e0afb2bc3e913062a9c51cab5d205 100644 (file)
@@ -1428,7 +1428,6 @@ run_gcc (unsigned argc, char *argv[])
   char **lto_argv, **ltoobj_argv;
   bool linker_output_rel = false;
   bool skip_debug = false;
-  unsigned n_debugobj;
   const char *incoming_dumppfx = dumppfx = NULL;
   static char current_dir[] = { '.', DIR_SEPARATOR, '\0' };
 
@@ -1871,7 +1870,6 @@ cont1:
 
   /* Copy the early generated debug info from the objects to temporary
      files and append those to the partial link commandline.  */
-  n_debugobj = 0;
   early_debug_object_names = NULL;
   if (! skip_debug)
     {
@@ -1881,10 +1879,7 @@ cont1:
        {
          const char *tem;
          if ((tem = debug_objcopy (ltoobj_argv[i], !linker_output_rel)))
-           {
-             early_debug_object_names[i] = tem;
-             n_debugobj++;
-           }
+           early_debug_object_names[i] = tem;
        }
     }
 
index e14b4e6c94a30a5d41bdc3d8b6cc6e702749480c..50a17927f39dbea067dc3e015c9a5fb923a6fd74 100644 (file)
@@ -2039,18 +2039,14 @@ switch_decision_tree::balance_case_nodes (case_tree_node **head,
   if (np)
     {
       int i = 0;
-      int ranges = 0;
       case_tree_node **npp;
       case_tree_node *left;
       profile_probability prob = profile_probability::never ();
 
-      /* Count the number of entries on branch.  Also count the ranges.  */
+      /* Count the number of entries on branch.  */
 
       while (np)
        {
-         if (!tree_int_cst_equal (np->m_c->get_low (), np->m_c->get_high ()))
-           ranges++;
-
          i++;
          prob += np->m_c->m_prob;
          np = np->m_right;
@@ -2063,8 +2059,8 @@ switch_decision_tree::balance_case_nodes (case_tree_node **head,
          left = *npp;
          profile_probability pivot_prob = prob.apply_scale (1, 2);
 
-         /* Find the place in the list that bisects the list's total cost,
-            where ranges count as 2.  */
+         /* Find the place in the list that bisects the list's total cost
+            by probability.  */
          while (1)
            {
              /* Skip nodes while their probability does not reach