From 3f73d6ef90458b45bbbb33ef4c2b174d4662a22d Mon Sep 17 00:00:00 2001 From: Jing Yu Date: Wed, 15 Feb 2012 15:40:16 -0800 Subject: Sync down FSF r184235@google/gcc-4_6_2-mobile branch 1) Get mostly new patches from FSF gcc-4.6 branch 2) Fix PR52129 3) Insert GNU-stack note for all ARM targets Change-Id: I2b9926981210e517e4021242908074319a91d6bd --- gcc-4.6/gcc/fortran/trans-expr.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'gcc-4.6/gcc/fortran/trans-expr.c') diff --git a/gcc-4.6/gcc/fortran/trans-expr.c b/gcc-4.6/gcc/fortran/trans-expr.c index 0487f75a0..773b2c62d 100644 --- a/gcc-4.6/gcc/fortran/trans-expr.c +++ b/gcc-4.6/gcc/fortran/trans-expr.c @@ -3326,10 +3326,16 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, else goto end_pointer_check; + tmp = parmse.expr; + + /* If the argument is passed by value, we need to strip the + INDIRECT_REF. */ + if (!POINTER_TYPE_P (TREE_TYPE (parmse.expr))) + tmp = gfc_build_addr_expr (NULL_TREE, tmp); cond = fold_build2_loc (input_location, EQ_EXPR, - boolean_type_node, parmse.expr, - fold_convert (TREE_TYPE (parmse.expr), + boolean_type_node, tmp, + fold_convert (TREE_TYPE (tmp), null_pointer_node)); } @@ -4309,10 +4315,8 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr) gfc_add_block_to_block (&block, &loop.pre); gfc_add_block_to_block (&block, &loop.post); - for (n = 0; n < cm->as->rank; n++) - mpz_clear (lss->shape[n]); - gfc_free (lss->shape); - + gcc_assert (lss->shape != NULL); + gfc_free_shape (&lss->shape, cm->as->rank); gfc_cleanup_loop (&loop); return gfc_finish_block (&block); @@ -6033,10 +6037,6 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, rss = NULL; if (lss != gfc_ss_terminator) { - /* Allow the scalarizer to workshare array assignments. */ - if (ompws_flags & OMPWS_WORKSHARE_FLAG) - ompws_flags |= OMPWS_SCALARIZER_WS; - /* The assignment needs scalarization. */ lss_section = lss; @@ -6092,6 +6092,10 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, gfc_mark_ss_chain_used (loop.temp_ss, 3); } + /* Allow the scalarizer to workshare array assignments. */ + if ((ompws_flags & OMPWS_WORKSHARE_FLAG) && loop.temp_ss == NULL) + ompws_flags |= OMPWS_SCALARIZER_WS; + /* Start the scalarized loop body. */ gfc_start_scalarized_body (&loop, &body); } @@ -6200,6 +6204,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, && !gfc_expr_attr (expr1).codimension && !gfc_is_coindexed (expr1)) { + ompws_flags &= ~OMPWS_SCALARIZER_WS; tmp = gfc_alloc_allocatable_for_assignment (&loop, expr1, expr2); if (tmp != NULL_TREE) gfc_add_expr_to_block (&loop.code[expr1->rank - 1], tmp); -- cgit v1.2.3