2013/7/29 Janus Weil <ja...@gcc.gnu.org>: > Hi Tobias, > >>> here is a fix for class pointer initialization. >> >> I think the patch looks reasonable. > > well, it may appear so ... > > >> Additionally, the CLASS are wrongly initialized: You only set "_data" >> (indirectly as it is the first field/component of the class) but you do not >> set the _vptr component. > > ... but as you point out, it clearly produces wrong code :( > > The attached new version should do the right thing now. At least it > shows the correct dump for the original test case as well as yours. It > is currently being regtested.
unfortunately it shows a couple of runtime problems with type-bound operators: FAIL: gfortran.dg/class_defined_operator_1.f03 -O0 execution test FAIL: gfortran.dg/typebound_operator_13.f03 -O0 execution test FAIL: gfortran.dg/typebound_operator_7.f03 -O0 execution test FAIL: gfortran.dg/typebound_operator_8.f03 -O0 execution test FAIL: gfortran.dg/typebound_operator_9.f03 -O0 execution test > gfortran-4.9 class_defined_operator_1.f03 > ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Will investigate ... Cheers, Janus