Hi all: This patch is fix constant memory's symbol_ref don't have right alignment info since `exp` don't set alignment (and should not set alignment info for `exp`) , use `decl` to set_mem_attributes for right alignment info.
ChangLog 2014-06-25 Kito Cheng <k...@0xlab.org> * varasm.c (build_constant_desc): Use decl to set mem attributes since exp don't have correct aligment info.
diff --git a/gcc/varasm.c b/gcc/varasm.c index 7be56f1..6e7ca5a 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -3201,7 +3201,7 @@ build_constant_desc (tree exp) TREE_CONSTANT_POOL_ADDRESS_P (symbol) = 1; rtl = gen_const_mem (TYPE_MODE (TREE_TYPE (exp)), symbol); - set_mem_attributes (rtl, exp, 1); + set_mem_attributes (rtl, decl, 1); set_mem_alias_set (rtl, 0); set_mem_alias_set (rtl, const_alias_set);