diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2007-11-18 17:14:40 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2007-11-18 17:14:40 +0000 |
commit | 129c14bd4c1b3a043bc2bb2c80b1c2030ea72713 (patch) | |
tree | 742fad5e58bb710c4972a11291e8b6bfb579fe21 /gcc/fortran/trans-array.c | |
parent | b5bf3e4d2eb38960cc2c6ac3b4b6dda7fe27fd43 (diff) | |
download | gcc-129c14bd4c1b3a043bc2bb2c80b1c2030ea72713.zip gcc-129c14bd4c1b3a043bc2bb2c80b1c2030ea72713.tar.gz gcc-129c14bd4c1b3a043bc2bb2c80b1c2030ea72713.tar.bz2 |
re PR fortran/31608 (wrong types in character array/scalar binop)
2007-11-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31608
* trans-array.c (gfc_conv_expr_descriptor): Remove exception
for indirect references in the call to gfc_trans_scalar_assign.
* trans-expr.c (gfc_conv_string_parameter): Instead of asserting
that the expression is not an indirect reference, cast it to a
pointer type of the length given by se->string_length.
2007-11-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31608
* gfortran.dg/char_cast_2.f90: New test based on achar_4.f90.
From-SVN: r130271
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index c418ae2..315279a 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -4734,15 +4734,10 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) gfc_add_block_to_block (&block, &rse.pre); gfc_add_block_to_block (&block, &lse.pre); - if (TREE_CODE (rse.expr) != INDIRECT_REF) - { - lse.string_length = rse.string_length; - tmp = gfc_trans_scalar_assign (&lse, &rse, expr->ts, true, - expr->expr_type == EXPR_VARIABLE); - gfc_add_expr_to_block (&block, tmp); - } - else - gfc_add_modify_expr (&block, lse.expr, rse.expr); + lse.string_length = rse.string_length; + tmp = gfc_trans_scalar_assign (&lse, &rse, expr->ts, true, + expr->expr_type == EXPR_VARIABLE); + gfc_add_expr_to_block (&block, tmp); /* Finish the copying loops. */ gfc_trans_scalarizing_loops (&loop, &block); |