diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-25 13:32:43 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-25 13:32:43 +0000 |
commit | 6a4da2cd21bd1417b2c434428a0d726dbf9293f1 (patch) | |
tree | 67df10f61f8cbcb8ffd8de4de015cba97f6bb04a /gcc/config | |
parent | bb19a97e0aad50d57f9ab1d0877dde2a5cf93295 (diff) | |
download | gcc-6a4da2cd21bd1417b2c434428a0d726dbf9293f1.tar.gz |
PR bootstrap/39645
* config/sparc/sparc.c (sparc_gimplify_va_arg): Set TREE_ADDRESSABLE
on the destination of memcpy.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146772 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/sparc/sparc.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index c3b5a6912fd..61c5700fa1b 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -5740,7 +5740,7 @@ sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, size = int_size_in_bytes (type); rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; align = 0; - + if (TARGET_ARCH64) { /* 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, addr = fold_convert (build_pointer_type (ptrtype), 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. - FIXME: This is inefficient. Usually we can do this - in registers. */ - else if (align == 0 - && TYPE_ALIGN (type) > BITS_PER_WORD) + + /* If the address isn't aligned properly for the type, we need a temporary. + FIXME: This is inefficient, usually we can do this in registers. */ + else if (align == 0 && TYPE_ALIGN (type) > BITS_PER_WORD) { tree tmp = create_tmp_var (type, "va_arg_tmp"); tree dest_addr = build_fold_addr_expr (tmp); - - tree copy = build_call_expr (implicit_built_in_decls[BUILT_IN_MEMCPY], 3, - dest_addr, - addr, - size_int (rsize)); - + tree copy = build_call_expr (implicit_built_in_decls[BUILT_IN_MEMCPY], + 3, dest_addr, addr, size_int (rsize)); + TREE_ADDRESSABLE (tmp) = 1; gimplify_and_add (copy, pre_p); addr = dest_addr; } + else 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); return build_va_arg_indirect_ref (addr); |