[Bug fortran/83224] creating character array from elements shorter than declared does not pad with whitespace properly and aborts
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 30 20:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83224
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |tkoenig at gcc dot gnu.org
Target Milestone|--- |8.0
--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This looks like this could work.
No time for a patch submission now, that will have to wait for
a few days.
--- frontend-passes.c (Revision 255181)
+++ frontend-passes.c (Arbeitskopie)
@@ -249,7 +249,7 @@ realloc_string_callback (gfc_code **c, int *walk_s
return 0;
expr1 = co->expr1;
- if (expr1->ts.type != BT_CHARACTER || expr1->rank != 0
+ if (expr1->ts.type != BT_CHARACTER
|| !gfc_expr_attr(expr1).allocatable
|| !expr1->ts.deferred)
return 0;
@@ -270,8 +270,9 @@ realloc_string_callback (gfc_code **c, int *walk_s
if (!found_substr)
return 0;
}
- else if (expr2->expr_type != EXPR_OP
- || expr2->value.op.op != INTRINSIC_CONCAT)
+ else if (expr2->expr_type != EXPR_ARRAY
+ && (expr2->expr_type != EXPR_OP
+ || expr2->value.op.op != INTRINSIC_CONCAT))
return 0;
More information about the Gcc-bugs
mailing list