diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-08-14 14:33:54 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-08-14 14:33:54 +0000 |
commit | 5321ffedee1b4e05b7fa56cab64c595516fd9533 (patch) | |
tree | ffda4ecce65bb72e54a07d8ed2c09288fa207b43 /gcc/fortran/intrinsic.c | |
parent | b31856d3ac23cf3dab1e95cb96230dc81564c84a (diff) | |
download | gcc-hsa.tar.gz |
Merged trunk revision 251080 into the hsa branchhsa
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/hsa@251093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r-- | gcc/fortran/intrinsic.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index 2f60fe8c877..8965d509882 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -4919,9 +4919,11 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag) if (ts->type == BT_UNKNOWN) goto bad; - /* NULL and zero size arrays get their type here. */ - if (expr->expr_type == EXPR_NULL - || (expr->expr_type == EXPR_ARRAY && expr->value.constructor == NULL)) + /* NULL and zero size arrays get their type here, unless they already have a + typespec. */ + if ((expr->expr_type == EXPR_NULL + || (expr->expr_type == EXPR_ARRAY && expr->value.constructor == NULL)) + && expr->ts.type == BT_UNKNOWN) { /* Sometimes the RHS acquire the type. */ expr->ts = *ts; |