if (AGGREGATE_TYPE_P (TREE_TYPE (decl)))
return true;
- /* We can only use copy-in/copy-out semantics for shared varibles
+ /* We can only use copy-in/copy-out semantics for shared variables
when we know the value is not accessible from an outer scope. */
if (shared_p)
{
for (si = bsi_start (entry_succ_bb); ; bsi_next (&si))
{
- tree stmt;
+ tree stmt, arg;
gcc_assert (!bsi_end_p (si));
stmt = bsi_stmt (si);
- if (TREE_CODE (stmt) == MODIFY_EXPR
- && TREE_CODE (TREE_OPERAND (stmt, 1)) == ADDR_EXPR
- && TREE_OPERAND (TREE_OPERAND (stmt, 1), 0)
+ if (TREE_CODE (stmt) != MODIFY_EXPR)
+ continue;
+
+ arg = TREE_OPERAND (stmt, 1);
+ STRIP_NOPS (arg);
+ if (TREE_CODE (arg) == ADDR_EXPR
+ && TREE_OPERAND (arg, 0)
== OMP_PARALLEL_DATA_ARG (entry_stmt))
{
if (TREE_OPERAND (stmt, 0) == DECL_ARGUMENTS (child_fn))
if (ctx->record_type)
{
t = build_fold_addr_expr (ctx->sender_decl);
+ /* fixup_child_record_type might have changed receiver_decl's type. */
+ t = fold_convert (TREE_TYPE (ctx->receiver_decl), t);
t = build2 (MODIFY_EXPR, void_type_node, ctx->receiver_decl, t);
append_to_statement_list (t, &new_body);
}