[Patch, fortran] PR fortran/95331 - Unlimited polymorphic arrays have wrong bounds

Thomas Koenig tkoenig@netcologne.de
Thu Jun 11 13:19:13 GMT 2020


Hi Jose,
> Proposed patch to PR95331 - Unlimited polymorphic arrays have wrong bounds.
> 
> Patch tested only on x86_64-pc-linux-gnu.

reviewed, ChangeLog reformatted, committed as
r11-1235-g2ee70f5d161edd99a7af97d166b251bcf83cd91b .

Thanks a lot for the patch!

Do you have interest in getting write access?

Regards

	Thomas

PR95331 - Unlimited polymorphic arrays have wrong bounds.

When iterating over a class array use the bounds provided by the
transformed descriptor (in sym->backend_decl) instead of the original
bounds of the array (in the descriptor passed in the class _data)
which are passed in se->expr.

The patch partially depends on the patch for PR52351 and PR85868, but
does not seems to break anything by itself.
	
gcc/fortran/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/95331
	* trans-array.c (gfc_conv_array_ref): For class array dummy
	arguments use the transformed descriptor in sym->backend_decl
	instead of the original descriptor.

gcc/testsuite/ChangeLog:

2020-06-11  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/95331
	* gfortran.dg/PR95331.f90: New test.


More information about the Fortran mailing list