This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] cse.c: Remove two effectively write-only variables.


Hi,

Attached is a patch to remove two effectively write-only variables,
max_elements_made and n_elements_made.

First, note that max_elements_made is effectively write-only.  Once we
remove it, n_elements_made would also become effectively write-only.

The patch removes these two variables.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2005-01-29  Kazu Hirata  <kazu@cs.umass.edu>

	* cse.c (n_elements_made, max_elements_made): Remove.
	(insert): Don't touch n_elements_made.
	(cse_main): Don't touch n_elements_made or max_elements_made.

Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.335
diff -u -d -p -r1.335 cse.c
--- cse.c	28 Jan 2005 17:12:08 -0000	1.335
+++ cse.c	29 Jan 2005 03:36:32 -0000
@@ -559,15 +559,6 @@ static struct table_elt *table[HASH_SIZE
 
 static struct table_elt *free_element_chain;
 
-/* Number of `struct table_elt' structures made so far for this function.  */
-
-static int n_elements_made;
-
-/* Maximum value `n_elements_made' has had so far in this compilation
-   for functions previously processed.  */
-
-static int max_elements_made;
-
 /* Set to the cost of a constant pool reference if one was found for a
    symbolic constant.  If this was found, it means we should try to
    convert constants into constant pool entries if they don't fit in
@@ -1493,10 +1484,7 @@ insert (rtx x, struct table_elt *classp,
   if (elt)
     free_element_chain = elt->next_same_hash;
   else
-    {
-      n_elements_made++;
-      elt = xmalloc (sizeof (struct table_elt));
-    }
+    elt = xmalloc (sizeof (struct table_elt));
 
   elt->exp = x;
   elt->canon_exp = NULL_RTX;
@@ -6725,10 +6713,6 @@ cse_main (rtx f, int nregs, FILE *file)
 
   reg_eqv_table = xmalloc (nregs * sizeof (struct reg_eqv_elem));
 
-  /* Reset the counter indicating how many elements have been made
-     thus far.  */
-  n_elements_made = 0;
-
   /* Find the largest uid.  */
 
   max_uid = get_max_uid ();
@@ -6813,9 +6797,6 @@ cse_main (rtx f, int nregs, FILE *file)
 #endif
     }
 
-  if (max_elements_made < n_elements_made)
-    max_elements_made = n_elements_made;
-
   /* Clean up.  */
   end_alias_analysis ();
   free (uid_cuid);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]