diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2011-11-09 09:51:49 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2011-11-09 09:51:49 +0000 |
commit | 7298eef346ba82d3e4e0a97ffd50ffa6469272e8 (patch) | |
tree | 21b7f86becc62380f19119a2313da5ef229932a3 /gcc | |
parent | 9c63ca5a1da8f003feff00d808d5d67931038d29 (diff) | |
download | gcc-7298eef346ba82d3e4e0a97ffd50ffa6469272e8.zip gcc-7298eef346ba82d3e4e0a97ffd50ffa6469272e8.tar.gz gcc-7298eef346ba82d3e4e0a97ffd50ffa6469272e8.tar.bz2 |
re PR fortran/50540 (Internal Error: Can't convert UNKNOWN to INTEGER(4) (r178939))
PR fortran/50540
* resolve.c (resolve_forall_iterators): Transform internal errors
to normal errors.
* gfortran.dg/forall_16.f90: New test.
From-SVN: r181200
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/forall_16.f90 | 9 |
4 files changed, 24 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4b65c73..6d7c35b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-11-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR fortran/50540 + * resolve.c (resolve_forall_iterators): Transform internal errors + to normal errors. + 2011-11-09 Janus Weil <janus@gcc.gnu.org> PR fortran/50960 @@ -8,7 +14,7 @@ be resolved again. (resolve_fl_parameter): Make sure the symbol has a value. -2011-11-08 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> +2011-11-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/38718 * intrinsic.c (add_functions): Allow dreal simplification. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 0a8fac6..d96b332 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -6427,14 +6427,14 @@ resolve_forall_iterators (gfc_forall_iterator *it) gfc_error ("FORALL start expression at %L must be a scalar INTEGER", &iter->start->where); if (iter->var->ts.kind != iter->start->ts.kind) - gfc_convert_type (iter->start, &iter->var->ts, 2); + gfc_convert_type (iter->start, &iter->var->ts, 1); if (gfc_resolve_expr (iter->end) == SUCCESS && (iter->end->ts.type != BT_INTEGER || iter->end->rank != 0)) gfc_error ("FORALL end expression at %L must be a scalar INTEGER", &iter->end->where); if (iter->var->ts.kind != iter->end->ts.kind) - gfc_convert_type (iter->end, &iter->var->ts, 2); + gfc_convert_type (iter->end, &iter->var->ts, 1); if (gfc_resolve_expr (iter->stride) == SUCCESS) { @@ -6448,7 +6448,7 @@ resolve_forall_iterators (gfc_forall_iterator *it) &iter->stride->where); } if (iter->var->ts.kind != iter->stride->ts.kind) - gfc_convert_type (iter->stride, &iter->var->ts, 2); + gfc_convert_type (iter->stride, &iter->var->ts, 1); } for (iter = it; iter; iter = iter->next) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e6e9049..c85c864 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2011-11-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + PR fortran/50540 + * gfortran.dg/forall_16.f90: New test. + +2011-11-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + PR fortran/38718 * gfortran.dg/initialization_29.f90: Expand test. diff --git a/gcc/testsuite/gfortran.dg/forall_16.f90 b/gcc/testsuite/gfortran.dg/forall_16.f90 new file mode 100644 index 0000000..017aa5a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/forall_16.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! PR fortran/50540 +! + implicit none + integer i,dest(10) + forall (i=2:ix) dest(i)=i ! { dg-error "has no IMPLICIT type" } +end + +! { dg-excess-errors "Can't convert UNKNOWN to INTEGER" } |