This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, OOP] PR 57306: ICE on valid with class pointer initialization
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 30 Jul 2013 00:39:43 +0200
- Subject: Re: [Patch, Fortran, OOP] PR 57306: ICE on valid with class pointer initialization
- References: <CAKwh3qgAJL9GRRDWfKp5MAx38DW=08P_CX2gV+JGEMVxkbj_fA at mail dot gmail dot com> <51F3977B dot 7060606 at net-b dot de> <CAKwh3qiHNtuqsgfqRkVbvxBvMs-YH47LT1sg05d4RuTA0Yr9Yw at mail dot gmail dot com>
2013/7/29 Janus Weil <janus@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