Fix increase_alignment

Jan Hubicka hubicka@ucw.cz
Wed Apr 1 23:21:00 GMT 2015


> 
> Your follow-up patch 88ada5e935d58223ae2d9ce6d0c1c71c372680a8 a.k.a r221269
> added this to emit_local():
> 
>  static bool
> -emit_local (tree decl ATTRIBUTE_UNUSED,
> +emit_local (tree decl,
>             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
>    ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name,
> -                                size, DECL_ALIGN (decl));
> +                                size, align);
>    return true;
>  #elif defined ASM_OUTPUT_ALIGNED_LOCAL
> -  ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, DECL_ALIGN (decl));
> +  ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align);
>    return true;
>  #else
>    ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
>    return false;
>  #endif
>  }
> 
> which gives
> 
> gcc/varasm.c:1936:7: error: unused variable ‘align’ [-Werror=unused-variable]
>    int align = symtab_node::get (decl)->definition_alignment ();
>        ^
> 
> on
> 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
> 
> Maybe just flag it as used or copy-move it?

Yep, lets just move it into the ifdefs. Can you please check that the alignment
looks right atone of those targets? I am not quite sure who is supposed to
do so on targets not defining ASM_OUTPUT_ALIGNED_LOCAL.

Perhaps we want then to prvent vectorizer from updating the alignments.

Honza
> 
> TIA,



More information about the Gcc-patches mailing list