* jump.c: Add prototype for mark_modified_reg.
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jul 2001 18:04:33 +0000 (18:04 +0000)
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Jul 2001 18:04:33 +0000 (18:04 +0000)
        * cse.c (set_live_p): Add unused attribute.

        * gcov.c (calculate_branch_probs): Use gcov_type to avoid
        overflow.
        (scan_for_source_files): Use long for count to avoid overflow.
        (output_data): Likewise.
        (output_data): Don't use string concatatenation to silence gcc
        -traditional.

        * predict.c: Fix typos and grammar.

        * gcse.c (insert_insn_end_bb): Remove unused variables.

For cp:
        * decl2.c: Remove unused var global_temp_name_counter.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44479 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cse.c
gcc/gcov.c
gcc/gcse.c
gcc/jump.c
gcc/predict.c

index 1bd21e5..1f96e87 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-30  Andreas Jaeger  <aj@suse.de>
+
+        * decl2.c: Remove unused var global_temp_name_counter.
+
 2001-07-28  Richard Henderson  <rth@redhat.com>
 
        * method.c (pending_inlines): Remove.
@@ -46,7 +50,7 @@
        declaring a function, and create last_function_parms correctly.
 
 2001-07-25  Jason Merrill  <jason_merrill@redhat.com>
-       
+
        * call.c (joust): Only prefer a non-builtin candidate to a builtin
        one if they have the same signature.
 
        * pt.c (instantiate_class_template): Don't set
        TYPE_VEC_DELETE_TAKES_SIZE.
        * NEWS: Document ABI changes from GCC 3.0.
-       
+
 2001-07-18  Xavier Delacour <xavier@fmaudio.net>,
             Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
 
index ef419bd..7ce343c 100644 (file)
@@ -104,10 +104,6 @@ static varray_type deferred_fns;
 #define deferred_fns_used \
   (deferred_fns ? deferred_fns->elements_used : 0)
 
-/* Same, but not reset.  Local temp variables and global temp variables
-   can have the same name.  */
-static int global_temp_name_counter;
-
 /* Flag used when debugging spew.c */
 
 extern int spew_debug;
index 7210118..5802ec5 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7489,7 +7489,7 @@ count_reg_usage (x, counts, dest, incr)
 static bool
 set_live_p (set, insn, counts)
      rtx set;
-     rtx insn;
+     rtx insn ATTRIBUTE_UNUSED;        /* Only used with HAVE_cc0.  */
      int *counts;
 {
 #ifdef HAVE_cc0
index 0251a65..ab21820 100644 (file)
@@ -788,7 +788,7 @@ scan_for_source_files ()
 {
   struct sourcefile *s_ptr = NULL;
   char *ptr;
-  int count;
+  long count;
   long line_num;
 
   /* Search the bb_data to find:
@@ -878,7 +878,7 @@ calculate_branch_probs (current_graph, block_num, branch_probs, last_line_num)
      struct arcdata **branch_probs;
      int last_line_num;
 {
-  int total;
+  gcov_type total;
   struct adj_list *arcptr;
   struct arcdata *end_ptr, *a_ptr;
 
@@ -990,7 +990,7 @@ output_data ()
   char *source_file_name;
   FILE *source_file;
   struct bb_info_list *current_graph;
-  int count;
+  long count;
   char *cptr;
   long block_num;
   long line_num;
@@ -1360,16 +1360,23 @@ output_data ()
                            else
                              {
                                if (output_branch_counts)
-                                 fnotice (gcov_file,
-                                          "call %d returns = "
-                                          HOST_WIDEST_INT_PRINT_DEC "\n",
-                                          i, a_ptr->total - a_ptr->hits);
+                                 {
+                                   char c[20];
+                                   sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+                                            a_ptr->total - a_ptr->hits);
+                                   fnotice (gcov_file,
+                                            "call %d returns = %s\n", i, c);
+                                 }
                                else
-                                  fnotice (gcov_file,
-                                          "call %d returns = "
-                                          HOST_WIDEST_INT_PRINT_DEC "%%\n",
-                                           i, 100 - ((a_ptr->hits * 100) +
-                                           (a_ptr->total >> 1))/a_ptr->total);
+                                 {
+                                   char c[20];
+                                   sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+                                            100 - ((a_ptr->hits * 100)
+                                                   + (a_ptr->total >> 1))
+                                            / a_ptr->total);
+                                   fnotice (gcov_file,
+                                            "call %d returns = %s%%\n", i, c);
+                                 }
                              }
                        }
                      else
@@ -1380,18 +1387,23 @@ output_data ()
                          else
                            {
                              if (output_branch_counts)
-                               fnotice (gcov_file,
-                                        "branch %d taken = "
-                                        HOST_WIDEST_INT_PRINT_DEC "\n",
-                                         i, a_ptr->hits);
+                               {
+                                 char c[20];
+                                 sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+                                          a_ptr->hits);
+                                 fnotice (gcov_file,
+                                          "branch %d taken = %s\n", i, c);
+                               }
                              else
+                               {
+                                 char c[20];
+                                 sprintf (c, HOST_WIDEST_INT_PRINT_DEC,
+                                          ((a_ptr->hits * 100)
+                                           + (a_ptr->total >> 1))
+                                          / a_ptr->total);
                                 fnotice (gcov_file,
-                                         "branch %d taken = "
-                                        HOST_WIDEST_INT_PRINT_DEC "%%\n", i,
-                                         ((a_ptr->hits * 100) +
-                                          (a_ptr->total >> 1))/
-                                          a_ptr->total);
-
+                                         "branch %d taken = %s%%\n", i, c);
+                               }
                            }
                        }
                   }
index 70ed275..4fe1b3b 100644 (file)
@@ -4628,10 +4628,6 @@ insert_insn_end_bb (expr, bb, pre)
      of exception handling.  */
   else if (GET_CODE (insn) == CALL_INSN)
     {
-      HARD_REG_SET parm_regs;
-      int nparm_regs;
-      rtx p;
-
       /* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers,
         we search backward and place the instructions before the first
         parameter is loaded.  Do this for everyone for consistency and a
index e77ba56..ddef4a1 100644 (file)
@@ -69,6 +69,7 @@ static void invert_exp_1              PARAMS ((rtx));
 static int invert_exp                  PARAMS ((rtx));
 static int returnjump_p_1              PARAMS ((rtx *, void *));
 static void delete_prior_computation    PARAMS ((rtx, rtx));
+static void mark_modified_reg          PARAMS ((rtx, rtx, void *));
 \f
 /* Alternate entry into the jump optimizer.  This entry point only rebuilds
    the JUMP_LABEL field in jumping insns and REG_LABEL notes in non-jumping
index 38b9a5b..36f59e0 100644 (file)
@@ -228,7 +228,7 @@ combine_predictions_for_insn (insn, bb)
             bb->index);
 
   /* We implement "first match" heuristics and use probability guessed
-     by predictor with smallest index.  In future we will use better
+     by predictor with smallest index.  In the future we will use better
      probability combination techniques.  */
   while (*pnote)
     {
@@ -304,8 +304,8 @@ estimate_probability (loops_info)
            {
              int header_found = 0;
              edge e;
-         
-             /* Loop branch heruistics - predict as taken an edge back to
+
+             /* Loop branch heuristics - predict as taken an edge back to
                 a loop's head.  */
              for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next)
                if (e->dest == loops_info->array[i].header
@@ -314,8 +314,9 @@ estimate_probability (loops_info)
                    header_found = 1;
                    predict_edge_def (e, PRED_LOOP_BRANCH, TAKEN);
                  }
-             /* Loop exit heruistics - predict as not taken an edge exiting
-                the loop if the conditinal has no loop header successors  */
+             /* Loop exit heuristics - predict as not taken an edge
+                exiting the loop if the conditinal has no loop header
+                successors.  */
              if (!header_found)
                for (e = BASIC_BLOCK(j)->succ; e; e = e->succ_next)
                  if (e->dest->index <= 0
@@ -408,7 +409,7 @@ estimate_probability (loops_info)
              && (XEXP (cond, 1) == const0_rtx
                  || (GET_CODE (XEXP (cond, 1)) == REG
                      && REG_POINTER (XEXP (cond, 1)))))
-           
+
            predict_insn_def (last_insn, PRED_POINTER, NOT_TAKEN);
          break;
        case NE:
@@ -487,7 +488,7 @@ estimate_probability (loops_info)
 }
 \f
 /* __builtin_expect dropped tokens into the insn stream describing
-   expected values of registers.  Generate branch probabilities 
+   expected values of registers.  Generate branch probabilities
    based off these values.  */
 
 void
@@ -535,7 +536,7 @@ expected_value_to_br_prob ()
                (set r71 -1)
                (set r80 (lt r70 r71))
                (set pc (if_then_else (ne r80 0) ...))
-        as canonicalize_condition will render this to us as 
+        as canonicalize_condition will render this to us as
                (lt r70, r71)
         Could use cselib to try and reduce this further.  */
       cond = XEXP (SET_SRC (PATTERN (insn)), 0);
@@ -545,7 +546,7 @@ expected_value_to_br_prob ()
          || GET_CODE (XEXP (cond, 1)) != CONST_INT)
        continue;
 
-      /* Substitute and simplify.  Given that the expression we're 
+      /* Substitute and simplify.  Given that the expression we're
         building involves two constants, we should wind up with either
         true or false.  */
       cond = gen_rtx_fmt_ee (GET_CODE (cond), VOIDmode,
@@ -560,7 +561,7 @@ expected_value_to_br_prob ()
     }
 }
 \f
-/* This is used to carry information about basic blocks.  It is 
+/* This is used to carry information about basic blocks.  It is
    attached to the AUX field of the standard CFG block.  */
 
 typedef struct block_info_def
@@ -620,19 +621,22 @@ propagate_freq (head)
            if (!BLOCK_INFO (e->src)->visited && !EDGE_INFO (e)->back_edge)
              break;
 
-         /* We didn't proceeded all predecesors of edge e yet.  These may
-            be waiting in the queue or we may hit irreducible region.
-
-            To avoid infinite looping on irrecudible regions, count number
-            of block proceeded at the time basic block has been queued.  In the
-            case number didn't changed, we've hit irreducible region and we
-            forget the backward edge.  This can increase time complexity
-            by the number of irreducible blocks, but in same way standard the
-            loop does, so it should not result in noticeable slowodwn.
-
-            Alternativly we may distinquish backward and cross edges in the
-            DFS tree by preprocesing pass and ignore existence of non-loop
-            backward edges.  */
+         /* We haven't proceeded all predecessors of edge e yet.
+            These may be waiting in the queue or we may hit an
+            irreducible region.
+
+            To avoid infinite looping on irrecudible regions, count
+            the number of blocks proceeded at the time the basic
+            block has been queued.  In the case the number doesn't
+            change, we've hit an irreducible region and we can forget
+            the backward edge.  This can increase the time complexity
+            by the number of irreducible blocks, but in the same way
+            the standard the loop does, so it should not result in a
+            noticeable slowdown.
+
+            Alternatively we may distinguish backward and cross edges
+            in the DFS tree by the preprocessing pass and ignore the
+            existence of non-loop backward edges.  */
          if (e && BLOCK_INFO (bb)->nvisited != nvisited)
            {
              if (!nextbb)
@@ -670,7 +674,7 @@ propagate_freq (head)
                                           * BLOCK_INFO (bb)->frequency
                                           / REG_BR_PROB_BASE);
 
-      /* Propagate to succesor blocks.  */
+      /* Propagate to successor blocks.  */
       for (e = bb->succ; e; e = e->succ_next)
        if (!EDGE_INFO (e)->back_edge
            && !BLOCK_INFO (e->dest)->visited
@@ -687,7 +691,7 @@ propagate_freq (head)
     }
 }
 
-/* Estimate probabilities of the loopback edges in loops at same nest level.  */
+/* Estimate probabilities of loopback edges in loops at same nest level.  */
 static void
 estimate_loops_at_level (first_loop)
      struct loop *first_loop;
@@ -701,13 +705,13 @@ estimate_loops_at_level (first_loop)
 
       estimate_loops_at_level (loop->inner);
 
-      /* find current loop back edge and mark it.  */
+      /* Find current loop back edge and mark it.  */
       for (e = loop->latch->succ; e->dest != loop->header; e = e->succ_next);
 
       EDGE_INFO (e)->back_edge = 1;
 
-      /* In case loop header is shared, ensure that it is the last one sharing
-         same header, so we avoid redundant work.  */
+      /* In case the loop header is shared, ensure that it is the last
+        one sharing the same header, so we avoid redundant work.  */
       if (loop->shared)
        {
          for (l = loop->next; l; l = l->next)
@@ -778,12 +782,12 @@ estimate_bb_frequencies (loops)
       edge fallthru, branch;
 
       if (GET_CODE (last_insn) != JUMP_INSN || !any_condjump_p (last_insn)
-         /* Avoid handling of conditionals jump jumping to fallthru edge.  */
+         /* Avoid handling of conditional jumps jumping to fallthru edge.  */
          || BASIC_BLOCK (i)->succ->succ_next == NULL)
        {
          /* We can predict only conditional jumps at the moment.
-            Expect each edge to be equall probable.
-            ?? In future we want to make abnormal edges improbable.  */
+            Expect each edge to be equally probable.
+            ?? In the future we want to make abnormal edges improbable.  */
          int nedges = 0;
          edge e;