aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 4393287..3658e43 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1754,6 +1754,14 @@ gfc_set_constant_character_len (gfc_charlen_t len, gfc_expr *expr,
free (expr->value.character.string);
expr->value.character.string = s;
expr->value.character.length = len;
+ /* If explicit representation was given, clear it
+ as it is no longer needed after padding. */
+ if (expr->representation.length)
+ {
+ expr->representation.length = 0;
+ free (expr->representation.string);
+ expr->representation.string = NULL;
+ }
}
}