[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-06-05 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from janus at gcc dot gnu.org ---
Fixed on trunk and 7-branch. Closing.

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-06-05 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #12 from janus at gcc dot gnu.org ---
Author: janus
Date: Mon Jun  5 09:31:32 2017
New Revision: 248873

URL: https://gcc.gnu.org/viewcvs?rev=248873=gcc=rev
Log:
2017-06-05  Janus Weil  

Backport from trunk
PR fortran/80766
* resolve.c (resolve_fl_derived): Make sure that vtype symbols are
properly resolved.

2017-06-05  Janus Weil  

Backport from trunk
PR fortran/80766
* gfortran.dg/typebound_call_28.f90: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/typebound_call_28.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/resolve.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-22 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #11 from janus at gcc dot gnu.org ---
Author: janus
Date: Mon May 22 17:08:24 2017
New Revision: 248341

URL: https://gcc.gnu.org/viewcvs?rev=248341=gcc=rev
Log:
2017-05-22  Janus Weil  

PR fortran/80766
* resolve.c (resolve_fl_derived): Make sure that vtype symbols are
properly resolved.

2017-05-22  Janus Weil  

PR fortran/80766
* gfortran.dg/typebound_call_28.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/typebound_call_28.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-21 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #10 from janus at gcc dot gnu.org ---
(In reply to Jerry DeLisle from comment #9)
> (In reply to janus from comment #8)
> > This shows one ICE in the testsuite:
> > 
> > FAIL: gfortran.dg/typebound_proc_32.f90   -O  (internal compiler error)
> 
> Is this before or after submission of patch to list?

That's an old patch. The one posted on the mailing list does the resolution
only if the vtab was freshly found via 'gfc_find_derived_vtab' and thus avoids
the ICE. Should have mentioned that, sorry!

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-21 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu.org

--- Comment #9 from Jerry DeLisle  ---
(In reply to janus from comment #8)
> (In reply to janus from comment #5)
> > This rather simple patch fixes the ICE on trunk:
> > 
> > Index: gcc/fortran/resolve.c
> > ===
> > --- gcc/fortran/resolve.c   (revision 247818)
> > +++ gcc/fortran/resolve.c   (working copy)
> > @@ -13833,6 +13833,9 @@ resolve_fl_derived (gfc_symbol *sym)
> >   gcc_assert (vtab);
> >   vptr->ts.u.derived = vtab->ts.u.derived;
> > }
> > +
> > +  if (!resolve_fl_derived0 (vptr->ts.u.derived))
> > +   return false;
> >  }
> >  
> >if (!resolve_fl_derived0 (sym))
> 
> This shows one ICE in the testsuite:
> 
> FAIL: gfortran.dg/typebound_proc_32.f90   -O  (internal compiler error)


Is this before or after submission of patch to list?

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-20 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #8 from janus at gcc dot gnu.org ---
(In reply to janus from comment #5)
> This rather simple patch fixes the ICE on trunk:
> 
> Index: gcc/fortran/resolve.c
> ===
> --- gcc/fortran/resolve.c (revision 247818)
> +++ gcc/fortran/resolve.c (working copy)
> @@ -13833,6 +13833,9 @@ resolve_fl_derived (gfc_symbol *sym)
> gcc_assert (vtab);
> vptr->ts.u.derived = vtab->ts.u.derived;
>   }
> +
> +  if (!resolve_fl_derived0 (vptr->ts.u.derived))
> + return false;
>  }
>  
>if (!resolve_fl_derived0 (sym))

This shows one ICE in the testsuite:

FAIL: gfortran.dg/typebound_proc_32.f90   -O  (internal compiler error)

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-20 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #7 from janus at gcc dot gnu.org ---
(In reply to janus from comment #6)
> I just verified that reverting the class.c parts of r241450 fixes the ICE as
> well. It does not show any failures on the select_type_* test cases either.
> I'm about to start a full regtest ...

That unfortunately shows one runtime failure (at all optimization levels):

FAIL: gfortran.dg/submodule_6.f08   -O0  execution test

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-20 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |janus at gcc dot gnu.org

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-20 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #6 from janus at gcc dot gnu.org ---
(In reply to janus from comment #4)
> I actually think that r241450 might be more relevant here than r241403 (in
> particular since it messes with gfc_find_derived_vtab).

I just verified that reverting the class.c parts of r241450 fixes the ICE as
well. It does not show any failures on the select_type_* test cases either. I'm
about to start a full regtest ...

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-20 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #5 from janus at gcc dot gnu.org ---
I have investigated a bit on the origin of the problem, and it seems that it is
related to the vtype symbols not being resolved properly (and the TBP component
having the type BT_UNKNOWN although it's a REAL function).

This rather simple patch fixes the ICE on trunk:

Index: gcc/fortran/resolve.c
===
--- gcc/fortran/resolve.c   (revision 247818)
+++ gcc/fortran/resolve.c   (working copy)
@@ -13833,6 +13833,9 @@ resolve_fl_derived (gfc_symbol *sym)
  gcc_assert (vtab);
  vptr->ts.u.derived = vtab->ts.u.derived;
}
+
+  if (!resolve_fl_derived0 (vptr->ts.u.derived))
+   return false;
 }

   if (!resolve_fl_derived0 (sym))

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-20 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #3)
> Revision r241395+patch (2016-10-21) is OK, r241433+patch (2016-10-21) gives
> the ICE. AFAICT the only possible revision is the range is r241403. However
> in the patches of r241433 I have the patch for r241450 (pr69834), but it
> looks also unrelated.

I actually think that r241450 might be more relevant here than r241403 (in
particular since it messes with gfc_find_derived_vtab).

[Bug fortran/80766] [7/8 Regression] [OOP] ICE with type-bound procedure returning an array

2017-05-20 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80766

--- Comment #3 from Dominique d'Humieres  ---
> > Confirmed, likely r241403 (pr69566).
>
> Not so sure here. Looks rather unrelated to me. Why do you think this one
> is the culprit?

Revision r241395+patch (2016-10-21) is OK, r241433+patch (2016-10-21) gives the
ICE. AFAICT the only possible revision is the range is r241403. However in the
patches of r241433 I have the patch for r241450 (pr69834), but it looks also
unrelated.