This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] SELECT TYPE via ASSOCIATE
Hi again,
thanks for the test!
Salvatore Filippone wrote:
Here you go; I've been able to tseal 10 mins (while waiting for a
colleague).
It's a variation of the original test case, and produces:
[sfilippo@donald bug20]$ ./bug20_dx
Dynamic type on entry: XBASE
Not implemented yet
Dynamic type CLASS DEFAULT clause: DBASE
which is pure nonsense :-)
I agree :) Looking at the tree-dump (and with some modification to your
code), I get:
{
struct class$d_base_sparse_mat_a * aa;
struct d_base_sparse_mat * tmp$type$d_base_sparse_mat;
aa = &a->a;
tmp$type$d_base_sparse_mat = aa->$data;
switch (aa->$vptr->$hash)
{
case 65139841:;
goto L.1;
default:;
{
character(kind=1) str.1[5];
struct class$d_base_sparse_mat class.0;
class.0.$vptr = (struct vtype$d_base_sparse_mat * {ref-all})
&vtab$d_base_sparse_mat;
class.0.$data = tmp$type$d_base_sparse_mat;
d_base_get_fmt ((character(kind=1)[1:5] *) &str.1, 5, &class.0);
__builtin_memmove ((void *) &string, (void *) &str.1, 5);
__builtin_memset ((void *) &string + 5, 32, 3);
}
{
struct __st_parameter_dt dt_parm.2;
dt_parm.2.common.filename = &"test.f03"[1]{lb: 1 sz: 1};
dt_parm.2.common.line = 78;
dt_parm.2.common.flags = 128;
dt_parm.2.common.unit = 0;
_gfortran_st_write (&dt_parm.2);
_gfortran_transfer_character (&dt_parm.2, &"Dynamic type
CLASS DEFAULT clause: "[1]{lb: 1 sz: 1}, 35);
_gfortran_transfer_character (&dt_parm.2, &string, 8);
_gfortran_st_write_done (&dt_parm.2);
}
goto L.1;
}
L.1:;
}
I don't think the dynamic type gets clobbered, but rather the CLASS
DEFAULT clause seems to use tmp$type$d_base_sparse_mat in case of "aa"
-- this probably is a problem with the select type selector stack; at
least this is the first that comes to mind.
Tobias suggested to check-in my patch anyways, and afterwards I (or
Janus, if he has an idea?) can try to fix this.
Thanks a lot for all your testing of OOP ;)
Daniel
--
http://www.pro-vegan.info/
--
Done: Arc-Bar-Cav-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Mon-Pri