This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] PR57456 - Handle ALLOCATE with typespec for CLASS


>> Currently, ALLOCATE ignores the typespec for arrays. Such that:
>>    ALLOCATE (t2 :: var(5))
>> will allocate as much memory as the base type requires instead of using as
>> much as "t2" does.
>>
>>
>> I explicitly exclude characters as it otherwise will fail for
>> allocate_with_typespec_1.f90, which uses:
>>      allocate(character :: c1(1))
>> The problem is that gfc_typenode_for_spec will return an array type and
>> not an element type, hence TYPE_SIZE_UNIT won't work. The current version is
>> fine, except for deferred-length strings. To properly handle it, one has to
>> do it as gfortran currently does for scalars. (Best by consolidating the
>> support. See PR.)
>>
>> As I want to work on other things first, I would like to get this in as
>> band aid - until someone has the time to do it properly. (I found it when
>> trying to write a test case for the already submitted final patch.)
>>
>> Build and regtested on x86-64-gnu-linux.
>> OK for the trunk?

Looks good. Thanks for the patch!

Cheers,
Janus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]