diff mbox

VECify record_layout_info.pending_statics

Message ID AANLkTin7xjlccC6NmbCV3uxpCgmlRaUSYDK-8LUrZxh5@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu June 18, 2010, 4:52 p.m. UTC
On Thu, Jun 17, 2010 at 11:51 AM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> As $SUBJECT suggests.  More TREE_LIST removal, yada, yada.
>
> Tested on x86_64-unknown-linux-gnu.  OK?
>
> -Nathan
>
>        * tree.h (record_layout_info): Change type of pending_statics field
>        to a VEC.
>        * stor-layout.c (start_record_layout): Store NULL into
>        pending_statics.
>        (debug_rli): Adjust for new type of pending_statics field.
>        (place_field): Likewise.
>        (finish_record_layout): Likewise.
>
> --- a/gcc/stor-layout.c
> +++ b/gcc/stor-layout.c
> @@ -743,7 +743,7 @@ start_record_layout (tree t)
>   rli->offset = size_zero_node;
>   rli->bitpos = bitsize_zero_node;
>   rli->prev_field = 0;
> -  rli->pending_statics = 0;
> +  rli->pending_statics = NULL;
>   rli->packed_maybe_necessary = 0;
>   rli->remaining_in_alignment = 0;
>
> @@ -827,10 +827,13 @@ debug_rli (record_layout_info rli)
>   if (rli->packed_maybe_necessary)
>     fprintf (stderr, "packed may be necessary\n");
>
> -  if (rli->pending_statics)
> +  if (!VEC_empty (tree, rli->pending_statics))
>     {
> +      unsigned ix;
> +      tree t;
>       fprintf (stderr, "pending statics:\n");
> -      debug_tree (rli->pending_statics);
> +      for (ix = 0; VEC_iterate (tree, rli->pending_statics, ix, t); ix++)
> +        debug_tree (t);
>     }
>  }
>

The checked-in version:

http://gcc.gnu.org/viewcvs/trunk/gcc/stor-layout.c?r1=161000&r2=160999&pathrev=161000

has

   if (rli->packed_maybe_necessary)
     fprintf (stderr, "packed may be necessary\n");

-  if (rli->pending_statics)
+  if (!VEC_empty (tree, rli->pending_statics))
     {
+      unsigned ix;
+      tree t;
       fprintf (stderr, "pending statics:\n");
-      debug_tree (rli->pending_statics);
+      debug_vec_tree (rli->pending_statics);
     }
 }

ix and t are unused. I got

 ../../src-trunk/gcc/store-motion.c -o store-motion.o
../../src-trunk/gcc/stor-layout.c: In function 'debug_rli':
../../src-trunk/gcc/stor-layout.c:833:12: error: unused variable 't'
[-Werror=unused-variable]
../../src-trunk/gcc/stor-layout.c:832:16: error: unused variable 'ix'
[-Werror=unused-variable]
cc1: all warnings being treated as errors

I checked in this patch as an obvious fix.
diff mbox

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 161007)
+++ ChangeLog	(working copy)
@@ -1,3 +1,7 @@ 
+2010-06-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* stor-layout.c (debug_rli): Remove unused local variables.
+
 2010-06-18  Eric Botcazou  <ebotcazou@adacore.com>

 	PR rtl-optimization/40900
Index: stor-layout.c
===================================================================
--- stor-layout.c	(revision 161007)
+++ stor-layout.c	(working copy)
@@ -829,8 +829,6 @@  debug_rli (record_layout_info rli)

   if (!VEC_empty (tree, rli->pending_statics))
     {
-      unsigned ix;
-      tree t;
       fprintf (stderr, "pending statics:\n");
       debug_vec_tree (rli->pending_statics);
     }