Message ID | 54D8ADD5.8020408@sfr.fr |
---|---|
State | New |
Headers | show |
Ping: https://gcc.gnu.org/ml/fortran/2015-02/msg00045.html
Mikael Morin wrote: > this is about a pointer bounds remapping regression introduced at > http://gcc.gnu.org/r190641 > [...] > The fix proposed clears the flag upon reuse, which should match exactly > the original behaviour, making it rather safe, and suitable also for the > branches. > I have to admit that I'm not completely satisfied with it however. > I would prefer no GFC_SE reuse at all, namely collect every piece of > code in a separate struct, and merge them later explicitly into a block. > Alas, the code is not exactly straightforward to my eyes, and my > attempt in that direction to sneak some orthogonality in that madness > failed. > > Anyway, regression tested on x86_64-linux, OK for trunk/4.9/4.8 ? > OK. Thanks for the patch - and sorry for the belate review. Tobias
Index: trans-expr.c =================================================================== --- trans-expr.c (révision 220514) +++ trans-expr.c (copie de travail) @@ -7339,6 +7339,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gf bound, bound, 0, GFC_ARRAY_POINTER_CONT, false); tmp = gfc_create_var (tmp, "ptrtemp"); + lse.descriptor_only = 0; lse.expr = tmp; lse.direct_byref = 1; gfc_conv_expr_descriptor (&lse, expr2); @@ -7354,6 +7355,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gf else if (expr2->expr_type == EXPR_VARIABLE) { /* Assign directly to the LHS's descriptor. */ + lse.descriptor_only = 0; lse.direct_byref = 1; gfc_conv_expr_descriptor (&lse, expr2); strlen_rhs = lse.string_length; @@ -7405,6 +7407,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gf /* Assign to a temporary descriptor and then copy that temporary to the pointer. */ tmp = gfc_create_var (TREE_TYPE (desc), "ptrtemp"); + lse.descriptor_only = 0; lse.expr = tmp; lse.direct_byref = 1; gfc_conv_expr_descriptor (&lse, expr2);