aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2019-02-17 21:14:14 +0000
committerHarald Anlauf <anlauf@gcc.gnu.org>2019-02-17 21:14:14 +0000
commite6ca33ba57dd55357cf2fd97c81fd12daca465a3 (patch)
tree149a62d2ada8627643ce242bbdef6b206fabdebe /gcc/fortran
parentdc20515ee57df80372f0f55011a67811ce82053e (diff)
downloadgcc-e6ca33ba57dd55357cf2fd97c81fd12daca465a3.zip
gcc-e6ca33ba57dd55357cf2fd97c81fd12daca465a3.tar.gz
gcc-e6ca33ba57dd55357cf2fd97c81fd12daca465a3.tar.bz2
re PR fortran/89077 (ICE using * as len specifier for character parameter)
2019-02-17 Harald Anlauf <anlauf@gmx.de> PR fortran/89077 * decl.c (gfc_set_constant_character_len): Clear original string representation after padding has been performed to target length. PR fortran/89077 * gfortran.dg/transfer_simplify_12.f90: New test. From-SVN: r268973
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/decl.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index fb01bf1..aa474a4 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-17 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/89077
+ * decl.c (gfc_set_constant_character_len): Clear original string
+ representation after padding has been performed to target length.
+
2019-02-16 Jakub Jelinek <jakub@redhat.com>
PR middle-end/88074
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;
+ }
}
}