[lto] c-common.c: Remove an unused variable.

Kazu Hirata kazu@codesourcery.com
Sat Jun 10 01:08:00 GMT 2006


Hi,

Attached is a patch to remove an unused variable.

While this patch seems irrelevant to the LTO branch at first glance,
it is actually relevant.  After I convert TYPE_ARG_TYPES to a
TREE_VEC, I am planning to walk a TREE_VEC like so:

  for (i = 0; i < TREE_VEC_LENGTH (arg_types); i++)

It would be confusing to have an extra iterator, namely "number", in
addition to "i".

Tested on x86_64-pc-linux-gnu.  Committed to the LTO branch as
obvious.

Kazu Hirata

2006-06-10  Kazu Hirata  <kazu@codesourcery.com>

	* c-common.c (sync_resolve_params): Remove an effectively
	write-only variable.

Index: c-common.c
===================================================================
--- c-common.c	(revision 114406)
+++ c-common.c	(working copy)
@@ -6241,14 +6241,12 @@ sync_resolve_params (tree orig_function,
 {
   tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (function));
   tree ptype;
-  int number;
 
   /* We've declared the implementation functions to use "volatile void *"
      as the pointer parameter, so we shouldn't get any complaints from the
      call to check_function_arguments what ever type the user used.  */
   arg_types = TREE_CHAIN (arg_types);
   ptype = TREE_TYPE (TREE_TYPE (TREE_VALUE (params)));
-  number = 2;
 
   /* For the rest of the values, we need to cast these to FTYPE, so that we
      don't get warnings for passing pointer types, etc.  */
@@ -6272,7 +6270,6 @@ sync_resolve_params (tree orig_function,
       TREE_VALUE (params) = val;
 
       arg_types = TREE_CHAIN (arg_types);
-      number++;
     }
 
   /* The definition of these primitives is variadic, with the remaining



More information about the Gcc-patches mailing list