Patchwork Fix recent warning about pending_assemble_externals_processed

login
register
mail settings
Submitter Jan-Benedict Glaw
Date Dec. 17, 2012, 4:42 p.m.
Message ID <20121217164217.GF10671@lug-owl.de>
Download mbox | patch
Permalink /patch/206917/
State New
Headers show

Comments

Jan-Benedict Glaw - Dec. 17, 2012, 4:42 p.m.
Hi!

I'd like to apply the following patch to fix a warning:

../../../../gcc/gcc/varasm.c:2094:13: warning: ‘pending_assemble_externals_processed’ defined but not used [-Wunused-variable]

(seen on microblaze-uclinux and pdp11-aout) introduced with a fix for
PR middle-end/55709 and 52894:

+2012-12-16  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR middle-end/55709
+       Forward port from 4.7 branch:
+       2012-04-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       PR middle-end/52894
+       * varasm.c (process_pending_assemble_externals): Set
+       pending_assemble_externals_processed true.
+       (assemble_external): Call assemble_external_real if the pending
+       assemble externals have been processed.

Okay to commit?



2012-12-17  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

	* gcc/varasm.c (pending_assemble_externals_processed): Guard
	with ASM_OUTPUT_EXTERNAL.
John David Anglin - Dec. 17, 2012, 5:08 p.m.
On 12/17/2012 11:42 AM, Jan-Benedict Glaw wrote:
> 2012-12-17  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
>
> 	* gcc/varasm.c (pending_assemble_externals_processed): Guard
> 	with ASM_OUTPUT_EXTERNAL.
This was fixed on trunk yesterday.  The warning must be present on 4.6 
and 4.7
but doesn't cause a build error.

Thanks,
Dave
Jan-Benedict Glaw - Dec. 17, 2012, 5:20 p.m.
On Mon, 2012-12-17 12:08:11 -0500, John David Anglin <dave.anglin@bell.net> wrote:
> On 12/17/2012 11:42 AM, Jan-Benedict Glaw wrote:
> >2012-12-17  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
> >
> >	* gcc/varasm.c (pending_assemble_externals_processed): Guard
> >	with ASM_OUTPUT_EXTERNAL.
> This was fixed on trunk yesterday.  The warning must be present on

Great. Takes a day until I'm up with my build robot...

Thanks, JBG
John David Anglin - Dec. 17, 2012, 5:24 p.m.
On 12/17/2012 12:08 PM, John David Anglin wrote:
> On 12/17/2012 11:42 AM, Jan-Benedict Glaw wrote:
>> 2012-12-17  Jan-Benedict Glaw <jbglaw@lug-owl.de>
>>
>>     * gcc/varasm.c (pending_assemble_externals_processed): Guard
>>     with ASM_OUTPUT_EXTERNAL.
> This was fixed on trunk yesterday.  The warning must be present on 4.6 
> and 4.7
> but doesn't cause a build error.
>
Sorry, I thought Dominique Dhumieres fixed this but I see he didn't 
apply his change.
I would say your change is obviously ok.

Dave
Jan-Benedict Glaw - Dec. 17, 2012, 5:27 p.m.
On Mon, 2012-12-17 12:24:58 -0500, John David Anglin <dave.anglin@bell.net> wrote:
> On 12/17/2012 12:08 PM, John David Anglin wrote:
> > On 12/17/2012 11:42 AM, Jan-Benedict Glaw wrote:
> > > 2012-12-17  Jan-Benedict Glaw <jbglaw@lug-owl.de>
> > >
> > >    * gcc/varasm.c (pending_assemble_externals_processed): Guard
> > >    with ASM_OUTPUT_EXTERNAL.
> > This was fixed on trunk yesterday.  The warning must be present on
> > 4.6 and 4.7
> > but doesn't cause a build error.
>
> Sorry, I thought Dominique Dhumieres fixed this but I see he didn't
> apply his change.
> I would say your change is obviously ok.

Will commit.

MfG, JBG

Patch

diff --git a/gcc/varasm.c b/gcc/varasm.c
index daeb6e2..53ebfbf 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2088,12 +2088,12 @@  contains_pointers_p (tree type)
    it all the way to final.  See PR 17982 for further discussion.  */
 static GTY(()) tree pending_assemble_externals;
 
+#ifdef ASM_OUTPUT_EXTERNAL
 /* Some targets delay some output to final using TARGET_ASM_FILE_END.
    As a result, assemble_external can be called after the list of externals
    is processed and the pointer set destroyed.  */
 static bool pending_assemble_externals_processed;
 
-#ifdef ASM_OUTPUT_EXTERNAL
 /* Avoid O(external_decls**2) lookups in the pending_assemble_externals
    TREE_LIST in assemble_external.  */
 static struct pointer_set_t *pending_assemble_externals_set;