This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about default_elf_asm_named_section function
- From: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Wed, 12 Oct 2011 15:14:35 -0700
- Subject: Question about default_elf_asm_named_section function
Hello Everyone,
This email is in reference to the "default_elf_asm_named_section" function in the varasm.c file.
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) == IDENTIFIER_NODE)
fprintf (asm_out_file, ",%s,comdat", IDENTIFIER_POINTER (decl));
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 "decl." Should we remove the attribute unused tag near the "tree decl" or is the if-statement a deadcode that should never be ?
Thanks,
Balaji V. Iyer.