Hi all,

This is a simple patch to change the align variable (used in emit_local()) from type "int" to type "unsigned int".

It should be defined as "unsigned int" which is the same data type returned by symtab_node::get (decl)->definition_alignment () For the maximum alignment allowed by GCC(without producing "error: requested alignment is too large"), "int" will overflow.

Okay to Commit on the trunk and backport to branch 5.0?

Regards,
Renlin Li

gcc/ChangeLog:

2015-06-04  Renlin Li  <renlin...@arm.com>

    * varasm.c (emit_local): Use unsigned int for align variable.
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 93b9699..8f9b7ec 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1960,12 +1960,12 @@ emit_local (tree decl ATTRIBUTE_UNUSED,
 	    unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED)
 {
 #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
-  int align = symtab_node::get (decl)->definition_alignment ();
+  unsigned 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 ();
+  unsigned int align = symtab_node::get (decl)->definition_alignment ();
   ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align);
   return true;
 #else

Reply via email to