OSDN Git Service

PR fortran/50540
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Nov 2011 09:51:49 +0000 (09:51 +0000)
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Nov 2011 09:51:49 +0000 (09:51 +0000)
* resolve.c (resolve_forall_iterators): Transform internal errors
to normal errors.
* gfortran.dg/forall_16.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181200 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/forall_16.f90 [new file with mode: 0644]

index 4b65c73..6d7c35b 100644 (file)
@@ -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.
index 0a8fac6..d96b332 100644 (file)
@@ -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)
index e6e9049..c85c864 100644 (file)
@@ -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 (file)
index 0000000..017aa5a
--- /dev/null
@@ -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" }