Commit 3764d512 by Eric Botcazou Committed by Eric Botcazou

re PR bootstrap/39645 (uninitialized variable in genattrtab.c)

	PR bootstrap/39645
	* config/sparc/sparc.c (sparc_gimplify_va_arg): Set TREE_ADDRESSABLE
	on the destination of memcpy.

From-SVN: r146772
parent a687f83c
2009-04-25 Eric Botcazou <ebotcazou@adacore.com>
PR bootstrap/39645
* config/sparc/sparc.c (sparc_gimplify_va_arg): Set TREE_ADDRESSABLE
on the destination of memcpy.
2009-04-25 Paolo Bonzini <bonzini@gnu.org> 2009-04-25 Paolo Bonzini <bonzini@gnu.org>
* doc/tm.texi (REGNO_OK_FOR_BASE_P, REGNO_MODE_OK_FOR_BASE_P, * doc/tm.texi (REGNO_OK_FOR_BASE_P, REGNO_MODE_OK_FOR_BASE_P,
......
...@@ -5740,7 +5740,7 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -5740,7 +5740,7 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
size = int_size_in_bytes (type); size = int_size_in_bytes (type);
rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
align = 0; align = 0;
if (TARGET_ARCH64) if (TARGET_ARCH64)
{ {
/* For SPARC64, objects requiring 16-byte alignment get it. */ /* For SPARC64, objects requiring 16-byte alignment get it. */
...@@ -5782,28 +5782,25 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -5782,28 +5782,25 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
addr = fold_convert (build_pointer_type (ptrtype), addr); addr = fold_convert (build_pointer_type (ptrtype), addr);
addr = build_va_arg_indirect_ref (addr); addr = build_va_arg_indirect_ref (addr);
} }
/* If the address isn't aligned properly for the type,
we may need to copy to a temporary. /* If the address isn't aligned properly for the type, we need a temporary.
FIXME: This is inefficient. Usually we can do this FIXME: This is inefficient, usually we can do this in registers. */
in registers. */ else if (align == 0 && TYPE_ALIGN (type) > BITS_PER_WORD)
else if (align == 0
&& TYPE_ALIGN (type) > BITS_PER_WORD)
{ {
tree tmp = create_tmp_var (type, "va_arg_tmp"); tree tmp = create_tmp_var (type, "va_arg_tmp");
tree dest_addr = build_fold_addr_expr (tmp); tree dest_addr = build_fold_addr_expr (tmp);
tree copy = build_call_expr (implicit_built_in_decls[BUILT_IN_MEMCPY],
tree copy = build_call_expr (implicit_built_in_decls[BUILT_IN_MEMCPY], 3, 3, dest_addr, addr, size_int (rsize));
dest_addr, TREE_ADDRESSABLE (tmp) = 1;
addr,
size_int (rsize));
gimplify_and_add (copy, pre_p); gimplify_and_add (copy, pre_p);
addr = dest_addr; addr = dest_addr;
} }
else else
addr = fold_convert (ptrtype, addr); addr = fold_convert (ptrtype, addr);
incr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr, size_int (rsize)); incr
= fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr, size_int (rsize));
gimplify_assign (valist, incr, post_p); gimplify_assign (valist, incr, post_p);
return build_va_arg_indirect_ref (addr); return build_va_arg_indirect_ref (addr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment