[Patch, fortran V2] PR fortran/100097 PR fortran/100098 - [Unlimited] polymorphic pointers and allocatables have incorrect rank

José Rui Faustino de Sousa jrfsousa@gmail.com
Wed Jun 16 16:38:26 GMT 2021

Hi All!

Proposed patch to:

PR100097 - Unlimited polymorphic pointers and allocatables have 
incorrect rank
PR100098 - Polymorphic pointers and allocatables have incorrect rank

Patch tested only on x86_64-pc-linux-gnu.

Version 2 no longer re-initializes explicit initialized variables, which 
are taken care of elsewhere.

Pointers, and allocatables, must carry TKR information even when 
undefined. The patch adds code to initialize, for both pointers and 
allocatables, the class descriptor element size, rank and type as soon 
as possible to do so.

Thank you very much.

Best regards,
José Rui

Fortran: Add missing TKR initialization to class variables [PR100097, 


     PR fortran/100097
     PR fortran/100098
     * trans-array.c (gfc_trans_class_array): new function to
     initialize class descriptor's TKR information.
     * trans-array.h (gfc_trans_class_array): add function prototype.
     * trans-decl.c (gfc_trans_deferred_vars): add calls to the new
     function for both pointers and allocatables.


     PR fortran/100097
     * gfortran.dg/PR100097.f90: New test.

     PR fortran/100098
     * gfortran.dg/PR100098.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR100098.patch
Type: text/x-patch
Size: 5350 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210616/4d3f1d96/attachment.bin>

More information about the Gcc-patches mailing list