This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, Fortran] PR fortran/60289 First try on: Fixing character array allocation for class(*) type variable
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Cc: Mikael Morin <mikael dot morin at sfr dot fr>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, vehre at gmx dot de, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Aug 2014 10:36:44 +0200
- Subject: Re: [PATCH, Fortran] PR fortran/60289 First try on: Fixing character array allocation for class(*) type variable
- Authentication-results: sourceware.org; auth=none
- References: <20140817124653 dot 1F3C2105 at mailhost dot lps dot ens dot fr> <53F0D4DF dot 6050907 at sfr dot fr> <20140817163904 dot A66CB105 at mailhost dot lps dot ens dot fr>
Dear All,
There are known issues with unlimited polymorphic variables
representing characters : see
https://groups.google.com/forum/#!topic/comp.lang.fortran/aRz3HMpblTs
and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55901
One way or another, the variable itself needs to carry the string
length and the kind. With fixed length and kind=1, the vtable 'size'
does the job.
Tobias has suggested more than once that we use the new array
descriptor as the class container as well. We either do this or add
fields to the class container.
Cheers
Paul
On 17 August 2014 18:39, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
>> Here is a failing testcase.
>
> I was about to post the same test. The test fails with two counts:
> (1) len(P) == 80,
> (2) deallocate(P) fails with
>
> a.out(882,0x7fff75e1d310) malloc: *** error for object 0x7fc801c04978: incorrect checksum for freed object - object was probably modified after being freed.
> ...
>
> Dominique
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy