[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2019-01-27 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

--- Comment #8 from Paul Thomas  ---
Author: pault
Date: Sun Jan 27 18:53:47 2019
New Revision: 268317

URL: https://gcc.gnu.org/viewcvs?rev=268317=gcc=rev
Log:
2019-01-27  Paul Thomas  

Backport from trunk
PR fortran/56386
PR fortran/58906
PR fortran/77385
PR fortran/80260
PR fortran/82077
* resolve.c (resolve_variable): Fix up expressions with array
associate names, where the parser did not detect that this is
array and there was no array part_ref in the expression.
* trans-expr.c (gfc_find_and_cut_at_last_class_ref): base_expr
should be a copy of e and not the initialization expr.

2019-01-27  Paul Thomas  

Backport from trunk
PR fortran/56386
PR fortran/58906
PR fortran/77385
* gfortran.dg/associate_44.f90 : New test.

PR fortran/80260
* gfortran.dg/select_type_45.f90 : New test.

PR fortran/82077
* gfortran.dg/select_type_46.f90 : New test.


Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/associate_44.f90
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/select_type_45.f90
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/select_type_46.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/resolve.c
branches/gcc-7-branch/gcc/fortran/trans-expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2019-01-27 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

--- Comment #7 from Paul Thomas  ---
Author: pault
Date: Sun Jan 27 18:02:17 2019
New Revision: 268313

URL: https://gcc.gnu.org/viewcvs?rev=268313=gcc=rev
Log:
2019-01-27  Paul Thomas  

Backport from trunk
PR fortran/56386
PR fortran/58906
PR fortran/77385
PR fortran/80260
PR fortran/82077
* resolve.c (resolve_variable): Fix up expressions with array
associate names, where the parser did not detect that this is
array and there was no array part_ref in the expression.
* trans-expr.c (gfc_find_and_cut_at_last_class_ref): base_expr
should be a copy of e and not the initialization expr.

2019-01-27  Paul Thomas  

Backport from trunk
PR fortran/56386
PR fortran/58906
PR fortran/77385
* gfortran.dg/associate_44.f90 : New test.

PR fortran/80260
* gfortran.dg/select_type_45.f90 : New test.

PR fortran/82077
* gfortran.dg/select_type_46.f90 : New test.


Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/associate_44.f90
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/select_type_45.f90
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/select_type_46.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/resolve.c
branches/gcc-8-branch/gcc/fortran/trans-expr.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2019-01-27 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Paul Thomas  ---
Fixed on trunk.

Thanks for the report.

Paul

[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2018-11-19 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #5 from Martin Liška  ---
Can the bug be marked as resolved?

[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2018-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

--- Comment #4 from Paul Thomas  ---
Author: pault
Date: Wed Oct 17 07:16:16 2018
New Revision: 265232

URL: https://gcc.gnu.org/viewcvs?rev=265232=gcc=rev
Log:
2018-10-17  Paul Thomas  

PR fortran/56386
PR fortran/58906
PR fortran/77385
PR fortran/80260
PR fortran/82077
* resolve.c (resolve_variable): Fix up expressions with array
associate names, where the parser did not detect that this is
array and there was no array part_ref in the expression.

2018-10-17  Paul Thomas  

PR fortran/56386
PR fortran/58906
PR fortran/77385
* gfortran.dg/associate_44.f90 : New test.

PR fortran/80260
* gfortran.dg/select_type_45.f90 : New test.

PR fortran/82077
* gfortran.dg/select_type_46.f90 : New test.


Added:
trunk/gcc/testsuite/gfortran.dg/associate_44.f90
trunk/gcc/testsuite/gfortran.dg/select_type_45.f90
trunk/gcc/testsuite/gfortran.dg/select_type_46.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2018-10-15 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

Paul Thomas  changed:

   What|Removed |Added

 CC||pault at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #3 from Paul Thomas  ---
According to Dominique's message to the list this morning, I have fixed this
one and so I had better take it.

Paul

[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2014-12-29 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

janus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||janus at gcc dot gnu.org

--- Comment #2 from janus at gcc dot gnu.org ---
Segfaults with 4.8, 4.9 and trunk.

Slightly reduced test case:

  TYPE :: child
CLASS(*), DIMENSION(:), POINTER :: arr
  END TYPE

CONTAINS

  SUBROUTINE f(r)
CLASS(child) ::  r
SELECT TYPE ( r )
CLASS IS ( child )
  SELECT TYPE( iarr=r%arr )
  TYPE IS ( INTEGER )
CALL func( iarr )
  END SELECT
END SELECT
  END SUBROUTINE

END


[Bug fortran/58906] [OOP] SELECT TYPE with CLASS IS generates ICE

2013-10-28 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58906

Tobias Burnus burnus at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-10-28
 CC||burnus at gcc dot gnu.org
Summary|SELECT TYPE with CLASS IS   |[OOP] SELECT TYPE with
   |generates ICE   |CLASS IS generates ICE
 Ever confirmed|0   |1

--- Comment #1 from Tobias Burnus burnus at gcc dot gnu.org ---
Confirmed.

ICEs in resolve_select_type for:
  SELECT TYPE( iarr=r%arr )

where r%arr is CLASS(*). Hence,

(gdb) p code-expr2-ts.u.derived-attr.unlimited_polymorphic
$6 = 1
(gdb) p code-expr2-ts.u.derived-ts.u.derived
$7 = (gfc_symbol *) 0x0

but the code does the following (last line derefs a NULL pointer).

7914  if (code-expr2)
7915{
7916  if (code-expr1-symtree-n.sym-attr.untyped)
7917code-expr1-symtree-n.sym-ts = code-expr2-ts;
7918  selector_type = CLASS_DATA (code-expr2)-ts.u.derived;