From patchwork Fri Jun 18 16:52:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 56209 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 103CB1007D5 for ; Sat, 19 Jun 2010 02:52:16 +1000 (EST) Received: (qmail 12535 invoked by alias); 18 Jun 2010 16:52:12 -0000 Received: (qmail 12502 invoked by uid 22791); 18 Jun 2010 16:52:10 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pv0-f175.google.com (HELO mail-pv0-f175.google.com) (74.125.83.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Jun 2010 16:52:05 +0000 Received: by pvh1 with SMTP id 1so67120pvh.20 for ; Fri, 18 Jun 2010 09:52:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.121.1 with SMTP id t1mr962897wfc.100.1276879923611; Fri, 18 Jun 2010 09:52:03 -0700 (PDT) Received: by 10.142.212.10 with HTTP; Fri, 18 Jun 2010 09:52:03 -0700 (PDT) In-Reply-To: <20100617185108.GP27105@codesourcery.com> References: <20100617185108.GP27105@codesourcery.com> Date: Fri, 18 Jun 2010 09:52:03 -0700 Message-ID: Subject: Re: [PATCH] VECify record_layout_info.pending_statics From: "H.J. Lu" To: Nathan Froyd Cc: gcc-patches@gcc.gnu.org X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Thu, Jun 17, 2010 at 11:51 AM, Nathan Froyd 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. Index: ChangeLog =================================================================== --- ChangeLog (revision 161007) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2010-06-18 H.J. Lu + + * stor-layout.c (debug_rli): Remove unused local variables. + 2010-06-18 Eric Botcazou 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); }