From c4b9a87e0df50293a420e98952c9593f58dcd1da Mon Sep 17 00:00:00 2001 From: Easwaran Raman Date: Fri, 24 Jun 2011 17:10:18 +0000 Subject: [PATCH] re PR rtl-optimization/49429 (dse.c change (r175063) causes execution failures) 2011-06-24 Easwaran Raman PR rtl-optimization/49429 PR target/49454 * expr.c (emit_block_move_hints): Mark MEM_EXPR(x) and MEM_EXPR(y) addressable if emit_block_move_via_libcall is used to copy y into x. * calls.c (initialize_argument_information): Mark an argument addressable if it is passed by invisible reference. (emit_library_call_value_1): Mark MEM_EXPR (val) addressable if it is passed by reference. From-SVN: r175384 --- gcc/ChangeLog | 12 ++++++++++++ gcc/calls.c | 9 ++++++++- gcc/expr.c | 15 +++++++++++++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f0c2f000eba..f0061058233 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2011-06-24 Easwaran Raman + + PR rtl-optimization/49429 + PR target/49454 + * expr.c (emit_block_move_hints): Mark MEM_EXPR(x) and + MEM_EXPR(y) addressable if emit_block_move_via_libcall is + used to copy y into x. + * calls.c (initialize_argument_information): Mark + an argument addressable if it is passed by invisible reference. + (emit_library_call_value_1): Mark MEM_EXPR (val) addressable + if it is passed by reference. + 2011-06-24 H.J. Lu PR rtl-optimization/49504 diff --git a/gcc/calls.c b/gcc/calls.c index 3d9a03f3632..bba477ce274 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1084,6 +1084,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, && TREE_CODE (base) != SSA_NAME && (!DECL_P (base) || MEM_P (DECL_RTL (base))))) { + mark_addressable (args[i].tree_value); + /* We can't use sibcalls if a callee-copied argument is stored in the current function's frame. */ if (!call_from_thunk_p && DECL_P (base) && !TREE_STATIC (base)) @@ -3524,7 +3526,12 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, } if (MEM_P (val) && !must_copy) - slot = val; + { + tree val_expr = MEM_EXPR (val); + if (val_expr) + mark_addressable (val_expr); + slot = val; + } else { slot = assign_temp (lang_hooks.types.type_for_mode (mode, 0), diff --git a/gcc/expr.c b/gcc/expr.c index bb6e3f14a8a..176978a2257 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -1181,8 +1181,19 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method, else if (may_use_call && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (x)) && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (y))) - retval = emit_block_move_via_libcall (x, y, size, - method == BLOCK_OP_TAILCALL); + { + /* Since x and y are passed to a libcall, mark the corresponding + tree EXPR as addressable. */ + tree y_expr = MEM_EXPR (y); + tree x_expr = MEM_EXPR (x); + if (y_expr) + mark_addressable (y_expr); + if (x_expr) + mark_addressable (x_expr); + retval = emit_block_move_via_libcall (x, y, size, + method == BLOCK_OP_TAILCALL); + } + else emit_block_move_via_loop (x, y, size, align); -- 2.30.2