aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/frontend-passes.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2016-07-09 22:18:29 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2016-07-09 22:18:29 +0000
commit36b54ce08eb893b4eac8ab8c27fde53249cf1b2c (patch)
treea8315c7053af143bba4b96785e75da8fb78e7268 /gcc/fortran/frontend-passes.c
parent08a357ce0ea57c8b2e6466b7361e52e2bb5b5cb2 (diff)
downloadgcc-36b54ce08eb893b4eac8ab8c27fde53249cf1b2c.zip
gcc-36b54ce08eb893b4eac8ab8c27fde53249cf1b2c.tar.gz
gcc-36b54ce08eb893b4eac8ab8c27fde53249cf1b2c.tar.bz2
re PR fortran/71783 (ICE on valid code in gimplify_var_or_parm_decl at gimplify.c:1801)
2016-07-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/71783 * frontend-passes.c (create_var): Always allocate a charlen for character variables. 2016-07-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/71783 * gfortran.dg/dependency_46.f90: New test. From-SVN: r238192
Diffstat (limited to 'gcc/fortran/frontend-passes.c')
-rw-r--r--gcc/fortran/frontend-passes.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index f02a52a..9ae3421 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -665,12 +665,10 @@ create_var (gfc_expr * e, const char *vname)
{
gfc_expr *length;
+ symbol->ts.u.cl = gfc_new_charlen (ns, NULL);
length = constant_string_length (e);
if (length)
- {
- symbol->ts.u.cl = gfc_new_charlen (ns, NULL);
- symbol->ts.u.cl->length = length;
- }
+ symbol->ts.u.cl->length = length;
else
symbol->attr.allocatable = 1;
}