From 6a4da2cd21bd1417b2c434428a0d726dbf9293f1 Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Sat, 25 Apr 2009 13:32:43 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/config/sparc/sparc.c | 25 +++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index afc41cc..6d2ae22 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-04-25 Eric Botcazou + + PR bootstrap/39645 + * config/sparc/sparc.c (sparc_gimplify_va_arg): Set TREE_ADDRESSABLE + on the destination of memcpy. + 2009-04-25 Paolo Bonzini * doc/tm.texi (REGNO_OK_FOR_BASE_P, REGNO_MODE_OK_FOR_BASE_P, diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index c3b5a69..61c5700 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); -- 2.7.4