[Bug fortran/19561] [gfortran] wrong code generation for pointers to derived types
paulthomas2 at wanadoo dot fr
gcc-bugzilla@gcc.gnu.org
Sat Jan 22 06:23:00 GMT 2005
------- Additional Comments From paulthomas2 at wanadoo dot fr 2005-01-22 06:19 -------
The problem is in the main program
type(objA),target :: oa
type(objB),target :: ob
call new(oa,1)
call new(ob,oa,2)
call print(ob)
call print(getOa(ob)) !<<here
end program test
This works
type(objA),target :: oa
type(objA),pointer :: ot !<<<
type(objB),target :: ob
call new(oa,1)
call new(ob,oa,2)
call print(ob)
ot=>getOa(ob) !<<< temporary pointer does
call print(ot) !<<< not survive. This does.
end program test
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19561
More information about the Gcc-bugs
mailing list