From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1358 invoked by alias); 14 Oct 2011 20:39:05 -0000 Received: (qmail 1342 invoked by uid 22791); 14 Oct 2011 20:39:04 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 20:38:47 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 14 Oct 2011 13:38:47 -0700 X-ExtLoop1: 1 Received: from azsmsx601.amr.corp.intel.com ([10.2.121.193]) by azsmga001.ch.intel.com with ESMTP; 14 Oct 2011 13:38:46 -0700 Received: from azsmsx604.amr.corp.intel.com (10.2.161.34) by azsmsx601.amr.corp.intel.com (10.2.121.193) with Microsoft SMTP Server (TLS) id 8.2.255.0; Fri, 14 Oct 2011 13:38:46 -0700 Received: from azsmsx502.amr.corp.intel.com ([10.2.121.75]) by azsmsx604.amr.corp.intel.com ([10.2.161.34]) with mapi; Fri, 14 Oct 2011 13:38:46 -0700 From: "Iyer, Balaji V" To: Ian Lance Taylor CC: "'gcc@gcc.gnu.org'" , "GCC Patches (gcc-patches@gcc.gnu.org)" Date: Sat, 15 Oct 2011 08:58:00 -0000 Subject: RE: Question about default_elf_asm_named_section function Message-ID: <2950715866004049A240A2F9BB410E7315F4307C56@azsmsx502.amr.corp.intel.com> References: <2950715866004049A240A2F9BB410E7315F42971CC@azsmsx502.amr.corp.intel.com> <2950715866004049A240A2F9BB410E7315F4307932@azsmsx502.amr.corp.intel.com> In-Reply-To: Content-Type: multipart/mixed; boundary="_002_2950715866004049A240A2F9BB410E7315F4307C56azsmsx502amrc_" MIME-Version: 1.0 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00231.txt.bz2 --_002_2950715866004049A240A2F9BB410E7315F4307C56azsmsx502amrc_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-length: 2282 Attached, please find a patch fixing this issue. 2011-10-14 Balaji V. Iyer * varasm.c (default_elf_asm_named_section): Removed ATTRIBUTE_UNUSED tag=20 before decl. Thanks, Balaji V. Iyer. -----Original Message----- From: Ian Lance Taylor [mailto:iant@google.com]=20 Sent: Friday, October 14, 2011 4:29 PM To: Iyer, Balaji V Cc: 'gcc@gcc.gnu.org' Subject: Re: Question about default_elf_asm_named_section function "Iyer, Balaji V" writes: > Can I submit a patch for it? Or is it a small thing that patch is not nec= essary? I will preapprove such a patch for anybody with commit access. Ian > -----Original Message----- > From: Ian Lance Taylor [mailto:iant@google.com]=20 > Sent: Friday, October 14, 2011 12:38 AM > To: Iyer, Balaji V > Cc: 'gcc@gcc.gnu.org' > Subject: Re: Question about default_elf_asm_named_section function > > "Iyer, Balaji V" writes: > >> This email is in reference to the "default_elf_asm_named_section" funct= ion in the varasm.c file.=20 >> >> This function is defined like this: >> >> void >> default_elf_asm_named_section (const char *name, unsigned int flags, >> tree decl ATTRIBUTE_UNUSED) >> >> >> But, inside the function, there is this if-statement: >> >> >> if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE)) >> { >> if (TREE_CODE (decl) =3D=3D IDENTIFIER_NODE) >> fprintf (asm_out_file, ",%s,comdat", IDENTIFIER_POINTER (dec= l)); >> else >> fprintf (asm_out_file, ",%s,comdat", >> IDENTIFIER_POINTER (DECL_COMDAT_GROUP (decl))); >> } >> >> >> The decl is set with "ATTRIBUTE_UNUSED" but the if-statement is using "d= ecl." Should we remove the attribute unused tag near the "tree decl" or is = the if-statement a deadcode that should never be ? > > > ATTRIBUTE_UNUSED does not mean "this parameter is never used." It means = "this parameter may not be used." The difference is due to #ifdefs--if a p= arameter is only used in code that is something #ifdef'ed out, then the par= ameter should be marked as ATTRIBUTE_UNUSED. > > In this case the parameter is always used, so we might as well remove the= ATTRIBUTE_UNUSED. > > Ian --_002_2950715866004049A240A2F9BB410E7315F4307C56azsmsx502amrc_ Content-Type: text/plain; name="default_elf_asm_patch.txt" Content-Description: default_elf_asm_patch.txt Content-Disposition: attachment; filename="default_elf_asm_patch.txt"; size=388; creation-date="Fri, 14 Oct 2011 13:32:39 GMT"; modification-date="Fri, 14 Oct 2011 13:32:54 GMT" Content-Transfer-Encoding: base64 Content-length: 529 ZGlmZiAtLWdpdCBhL2djYy92YXJhc20uYyBiL2djYy92YXJhc20uYw0KaW5k ZXggZTgzYmViYi4uOTRjODY1YyAxMDA2NDQNCi0tLSBhL2djYy92YXJhc20u Yw0KKysrIGIvZ2NjL3ZhcmFzbS5jDQpAQCAtNjE0Miw3ICs2MTQyLDcgQEAg ZGVmYXVsdF9ub19uYW1lZF9zZWN0aW9uIChjb25zdCBjaGFyICpuYW1lIEFU VFJJQlVURV9VTlVTRUQsDQogDQogdm9pZA0KIGRlZmF1bHRfZWxmX2FzbV9u YW1lZF9zZWN0aW9uIChjb25zdCBjaGFyICpuYW1lLCB1bnNpZ25lZCBpbnQg ZmxhZ3MsDQotCQkJICAgICAgIHRyZWUgZGVjbCBBVFRSSUJVVEVfVU5VU0VE KQ0KKwkJCSAgICAgICB0cmVlIGRlY2wpDQogew0KICAgY2hhciBmbGFnY2hh cnNbMTBdLCAqZiA9IGZsYWdjaGFyczsNCiANCg== --_002_2950715866004049A240A2F9BB410E7315F4307C56azsmsx502amrc_--