[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2016-11-16 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

janus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||janus at gcc dot gnu.org
   Target Milestone|--- |5.0

[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2015-02-11 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

Dominique d'Humieres dominiq at lps dot ens.fr changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #6 from Dominique d'Humieres dominiq at lps dot ens.fr ---
AFAICT all the tests in this PR compile now without any problem. May I close it
as FIXED?


[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2015-02-11 Thread paul.richard.thomas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

--- Comment #7 from paul.richard.thomas at gmail dot com paul.richard.thomas 
at gmail dot com ---
For sure. Please do.

Thanks

Paul

On 11 February 2015 at 18:25, dominiq at lps dot ens.fr
gcc-bugzi...@gcc.gnu.org wrote:
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

 Dominique d'Humieres dominiq at lps dot ens.fr changed:

What|Removed |Added
 
  Status|NEW |WAITING

 --- Comment #6 from Dominique d'Humieres dominiq at lps dot ens.fr ---
 AFAICT all the tests in this PR compile now without any problem. May I close 
 it
 as FIXED?

 --
 You are receiving this mail because:
 You are on the CC list for the bug.
 You are the assignee for the bug.


[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2015-02-11 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

Dominique d'Humieres dominiq at lps dot ens.fr changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Dominique d'Humieres dominiq at lps dot ens.fr ---
 For sure. Please do.

Done!


[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2014-10-20 Thread patnel97269-gfortran at yahoo dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

--- Comment #5 from patnel97269-gfortran at yahoo dot fr ---
Thanks for the patch. 

Another similar case, this time the type contains an allocatable field,
produces a internal compiler error (without applying the patch) :

 internal compiler error: in fold_convert_loc, at fold-const.c:2112


program toto
implicit none

type mother
integer :: i
double precision,dimension(:),allocatable :: values
end type mother


class(mother),allocatable :: cm,cm2

allocate(cm)
allocate(cm%values(10))
cm%i=3
cm%values=80d0
allocate(cm2)
select type(cm2)
type is (mother)
cm2=cm
end select
print *,cm2%i,cm2%values
end program


[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2014-10-18 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

--- Comment #4 from Paul Thomas pault at gcc dot gnu.org ---
Author: pault
Date: Sat Oct 18 14:35:51 2014
New Revision: 216427

URL: https://gcc.gnu.org/viewcvs?rev=216427root=gccview=rev
Log:
2014-10-18  Paul Thomas  pa...@gcc.gnu.org

PR fortran/63553
* resolve.c (resolve_ordinary_assign): Add data component to
rvalue expression for class to type assignment.

2014-10-18  Paul Thomas  pa...@gcc.gnu.org

PR fortran/63553
* gfortran.dg/class_to_type_3.f03 : New test

Added:
trunk/gcc/testsuite/gfortran.dg/class_to_type_3.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog


[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2014-10-16 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

Dominique d'Humieres dominiq at lps dot ens.fr changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-10-16
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres dominiq at lps dot ens.fr ---
Confirmed on 4.9.1 up to trunk (5.0). 4.8.3 gives the error

pr63553.f90:21.3:

tm=cm
   1
Error: Can't convert CLASS(mother) to TYPE(mother) at (1)


[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2014-10-16 Thread patnel97269-gfortran at yahoo dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

patnel97269-gfortran at yahoo dot fr changed:

   What|Removed |Added

 CC||patnel97269-gfortran@yahoo.
   ||fr

--- Comment #2 from patnel97269-gfortran at yahoo dot fr ---
As I wrote here https://gcc.gnu.org/ml/fortran/2014-10/msg00079.html, 

I think this case is also related : 


program toto
implicit none

type mother
integer :: i
end type mother
type,extends(mother) :: child
end type child

type(mother) :: tm
type(child) :: tc
class(mother),allocatable :: cm,cm2
class(child),allocatable :: cc

 allocate(cm)
 allocate(child::cm2)
 cm%i=10
 select type (cm2)
 type is (child)
cm2%mother=cm
 end select
 print *,'class cm2 is type tm',extends_type_of(cm2,tm)
 print *,'class cm2 is class cm',extends_type_of(cm2,cm)
 print *,'class cm2 is type tc',extends_type_of(cm2,tc)
 print *,'class cm2 is class cc',extends_type_of(cm2,cc)
 print *,'cm2=cm', cm%i,cm2%i

end program


[Bug fortran/63553] [OOP] Wrong code when assigning a CLASS to a TYPE

2014-10-16 Thread paul.richard.thomas at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63553

paul.richard.thomas at gmail dot com paul.richard.thomas at gmail dot com 
changed:

   What|Removed |Added

 CC||paul.richard.thomas at gmail 
dot c
   ||om

--- Comment #3 from paul.richard.thomas at gmail dot com paul.richard.thomas 
at gmail dot com ---
Created attachment 33742
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33742action=edit
patch

This fixes both testcases but causes a few trivial regressions:
class_array_15.f03
data_constraints_4.f90
data_constraints_6.f90

The fix is applied in the wrong place and the above regressions are easily
fixed.

It will be done tonight!

Paul