emit_local(): Fix unused warning
authoraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Apr 2015 17:56:18 +0000 (17:56 +0000)
committeraldot <aldot@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Apr 2015 17:56:18 +0000 (17:56 +0000)
Honzas r221269 produced

gcc/varasm.c:1936:7: error: unused variable ‘align’
[-Werror=unused-variable]
   int align = symtab_node::get (decl)->definition_alignment ();
       ^
on e.g.:

log/alpha64-dec-vms
log/alpha-dec-vms
log/i686-cygwinOPT-enable-threads=yes
log/i686-mingw32crt
log/i686-openbsd3.0
log/i686-pc-msdosdjgpp
log/m68k-openbsd

Silence this by moving the variable into the corresponding blocks and
adding back the ATTRIBUTE_UNUSED decoration for the decl param.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221925 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/varasm.c

index e97439f..54569fb 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-08  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
+
+       * varasm.c (emit_local): Move definition of align.
+
 2015-04-08  Julian Brown  <julian@codesourcery.com>
 
        * config/nvptx/mkoffload.c (process): Support variable mapping.
index 537a64d..e644b1d 100644 (file)
@@ -1928,17 +1928,18 @@ assemble_string (const char *p, int size)
 /* A noswitch_section_callback for lcomm_section.  */
 
 static bool
-emit_local (tree decl,
+emit_local (tree decl ATTRIBUTE_UNUSED,
            const char *name ATTRIBUTE_UNUSED,
            unsigned HOST_WIDE_INT size ATTRIBUTE_UNUSED,
            unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED)
 {
-  int align = symtab_node::get (decl)->definition_alignment ();
 #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
+  int align = symtab_node::get (decl)->definition_alignment ();
   ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name,
                                 size, align);
   return true;
 #elif defined ASM_OUTPUT_ALIGNED_LOCAL
+  int align = symtab_node::get (decl)->definition_alignment ();
   ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align);
   return true;
 #else