This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/80752] [5/6/7/8 Regression] ICE with wrong type initialization


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

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Mon, May 15, 2017 at 05:57:38PM +0000, kargl at gcc dot gnu.org wrote:
> 
> --- Comment #2 from kargl at gcc dot gnu.org ---
> Here's two possible patches.
>
Here's a 3rd possible patch, and it appears to do what is
needed.

Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c  (revision 248066)
+++ gcc/fortran/expr.c  (working copy)
@@ -4395,7 +4395,12 @@ 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);
+           {
+             bool val;
+             val = gfc_convert_type_warn (ctor->expr, &comp->ts, 1, false);
+             if (val == false)
+               return NULL;
+           }
        }

       if (comp->attr.allocatable

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]