diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 17 |
2 files changed, 11 insertions, 14 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7f53a8e..a46e79a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2008-12-09 Mikael Morin <mikael.morin@tele2.fr> + + PR fortran/35983 + * trans-expr.c (gfc_trans_subcomponent_assign): + Add se's pre and post blocks to current block. + (gfc_trans_structure_assign): Remove specific handling + of C_NULL_PTR and C_NULL_FUNPTR. + 2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/38425 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 5d3894c..4ecfa08 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -3670,8 +3670,10 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr) { gfc_init_se (&se, NULL); gfc_conv_expr (&se, expr); + gfc_add_block_to_block (&block, &se.pre); gfc_add_modify (&block, dest, fold_convert (TREE_TYPE (dest), se.expr)); + gfc_add_block_to_block (&block, &se.post); } else { @@ -3713,21 +3715,8 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr) { /* Skip absent members in default initializers. */ if (!c->expr) - continue; + continue; - /* Update the type/kind of the expression if it represents either - C_NULL_PTR or C_NULL_FUNPTR. This is done here because this may - be the first place reached for initializing output variables that - have components of type C_PTR/C_FUNPTR that are initialized. */ - if (c->expr->ts.type == BT_DERIVED && c->expr->ts.derived - && c->expr->ts.derived->attr.is_iso_c) - { - c->expr->expr_type = EXPR_NULL; - c->expr->ts.type = c->expr->ts.derived->ts.type; - c->expr->ts.f90_type = c->expr->ts.derived->ts.f90_type; - c->expr->ts.kind = c->expr->ts.derived->ts.kind; - } - field = cm->backend_decl; tmp = fold_build3 (COMPONENT_REF, TREE_TYPE (field), dest, field, NULL_TREE); |