https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80752

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
Here's two possible patches.  The first possible patch
converts the reported error from an internal error to a
fatal error.

Index: gcc/fortran/intrinsic.c
===================================================================
--- gcc/fortran/intrinsic.c     (revision 248066)
+++ gcc/fortran/intrinsic.c     (working copy)
@@ -4900,7 +4900,7 @@ gfc_convert_type (gfc_expr *expr, gfc_ty
    The possible values are:

      1 Generate a gfc_error()
-     2 Generate a gfc_internal_error().
+     2 Generate a gfc_fatal_error().

    'wflag' controls the warning related to conversion.  */

@@ -5064,7 +5064,7 @@ bad:
       return false;
     }

-  gfc_internal_error ("Can't convert %qs to %qs at %L",
+  gfc_fatal_error ("Can't convert %qs to %qs at %L",
                      gfc_typename (&from_ts), gfc_typename (ts),
                      &expr->where);
   /* Not reached */

The second possible patch allows the gfortran to continue
processing the code, but the error is repeated 3 times.

Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c  (revision 248066)
+++ gcc/fortran/expr.c  (working copy)
@@ -4395,7 +4395,7 @@ gfc_generate_initializer (gfc_typespec *
          if ((comp->ts.type != tmp->ts.type
               || comp->ts.kind != tmp->ts.kind)
              && !comp->attr.pointer && !comp->attr.proc_pointer)
-           gfc_convert_type_warn (ctor->expr, &comp->ts, 2, false);
+           gfc_convert_type_warn (ctor->expr, &comp->ts, 1, false);
        }

       if (comp->attr.allocatable

Reply via email to