Message ID | 56069950.8080203@sfr.fr |
---|---|
State | New |
Headers | show |
Dear Mikael, Apart from the regtesting, this patch is 'obvious'. This is good for trunk and, I would suggest, after a decent interval 5 branch. Thanks for the PR and the patch. Paul On 26 September 2015 at 15:10, Mikael Morin <mikael.morin@sfr.fr> wrote: > Hello, > > I've just submitted this PR, and the patch as well, which passes the > testsuite. > > The problem is a missing deep copy when the rhs is a (scalar) derived type > constructor (with allocatable components) and the lhs an array. > The patch removes the nonconstantness condition, so that the deep_copy flag > passed to gfc_trans_scalar_assign is set to true. > > Regression-tested on x86_64-unknown-linux-gnu. OK for trunk? > Mikael >
On Sat, Sep 26, 2015 at 6:10 AM, Mikael Morin <mikael.morin@sfr.fr> wrote: > Hello, > > I've just submitted this PR, and the patch as well, which passes the > testsuite. > > The problem is a missing deep copy when the rhs is a (scalar) derived type > constructor (with allocatable components) and the lhs an array. > The patch removes the nonconstantness condition, so that the deep_copy flag > passed to gfc_trans_scalar_assign is set to true. > > Regression-tested on x86_64-unknown-linux-gnu. OK for trunk? > Mikael > This caused: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67818 on GCC 5 branch.
On Fri, Oct 02, 2015 at 09:33:33AM -0700, H.J. Lu wrote: > On Sat, Sep 26, 2015 at 6:10 AM, Mikael Morin <mikael.morin@sfr.fr> wrote: > > Hello, > > > > I've just submitted this PR, and the patch as well, which passes the > > testsuite. > > > > The problem is a missing deep copy when the rhs is a (scalar) derived type > > constructor (with allocatable components) and the lhs an array. > > The patch removes the nonconstantness condition, so that the deep_copy flag > > passed to gfc_trans_scalar_assign is set to true. > > > > Regression-tested on x86_64-unknown-linux-gnu. OK for trunk? > > Mikael > > > > This caused: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67818 > > on GCC 5 branch. > Fairly, uninformative bug report.
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index cfa1a71..e086fe3 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -9232,7 +9232,6 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, scalar_to_array = (expr2->ts.type == BT_DERIVED && expr2->ts.u.derived->attr.alloc_comp && !expr_is_variable (expr2) - && !gfc_is_constant_expr (expr2) && expr1->rank && !expr2->rank); scalar_to_array |= (expr1->ts.type == BT_DERIVED && expr1->rank