gcc/libgfortran
Andre Vehreschild e4f2f46e01 Fortran: Fix rejecting class arrays of different ranks as storage association argument and add un/pack_class. [PR96992]
Removing the assert in trans-expr, lead to initial strides not set
which is now fixed.  When the array needs repacking, this is done for
class arrays now, too.

Packing class arrays was done using the regular internal pack
function in the past.  But that does not use the vptr's copy
function and breaks OOP paradigms (e.g. deep copy).  The new
un-/pack_class functions use the vptr's copy functionality to
implement OOP paradigms correctly.

	PR fortran/96992

gcc/fortran/ChangeLog:

	* trans-array.cc (gfc_trans_array_bounds): Set a starting
	stride, when descriptor expects a variable for the stride.
	(gfc_trans_dummy_array_bias): Allow storage association for
	dummy class arrays, when they are not elemental.
	(gfc_conv_array_parameter): Add more general class support
	and packing for classes, too.
	* trans-array.h (gfc_conv_array_parameter): Add lbound shift
	for class arrays.
	* trans-decl.cc (gfc_build_builtin_function_decls): Add decls
	for internal_un-/pack_class.
	* trans-expr.cc (gfc_reset_vptr): Allow supplying a type-tree
	to generate the vtab from.
	(gfc_class_set_vptr): Allow supplying a class-tree to take the
	vptr from.
	(class_array_data_assign): Rename to gfc_class_array_data_assign
	and make usable from other compile units.
	(gfc_class_array_data_assign): Renamed from class_array_data_
	assign.
	(gfc_conv_derived_to_class): Remove assert to
	allow converting derived to class type arrays with assumed
	rank.  Reduce code base and use gfc_conv_array_parameter also
	for classes.
	(gfc_conv_class_to_class): Use gfc_class_data_assign.
	(gfc_conv_procedure_call): Adapt to new signature of
	gfc_conv_derived_to_class.
	* trans-io.cc (transfer_expr): Same.
	* trans-stmt.cc (trans_associate_var): Same.
	* trans.h (gfc_conv_derived_to_class): Signature changed.
	(gfc_class_array_data_assign): Made public.
	(gfor_fndecl_in_pack_class): Added declaration.
	(gfor_fndecl_in_unpack_class): Same.

libgfortran/ChangeLog:

	* Makefile.am: Add in_un-/pack_class.c to build.
	* Makefile.in: Regenerated from Makefile.am.
	* gfortran.map: Added new functions and bumped ABI.
	* libgfortran.h (GFC_CLASS_T): Added for generating class
	representation at runtime.
	* runtime/in_pack_class.c: New file.
	* runtime/in_unpack_class.c: New file.

gcc/testsuite/ChangeLog:

	* gfortran.dg/class_dummy_11.f90: New test.
2024-07-11 09:47:44 +02:00
..
caf Update copyright years. 2024-01-03 12:19:35 +01:00
config aix: Fix building fat library for AIX 2024-05-06 18:36:41 -04:00
generated Update copyright years. 2024-01-03 12:19:35 +01:00
ieee Update copyright years. 2024-01-03 12:19:35 +01:00
intrinsics Fortran: add SELECTED_LOGICAL_KIND 2024-04-29 16:24:20 +02:00
io Fortran: Accept again tab as alternative to space as separator [PR114304] 2024-04-08 21:47:51 +02:00
m4 Update copyright years. 2024-01-03 12:19:35 +01:00
runtime Fortran: Fix rejecting class arrays of different ranks as storage association argument and add un/pack_class. [PR96992] 2024-07-11 09:47:44 +02:00
acinclude.m4 fortran: Add -static-libquadmath support [PR46539] 2022-08-17 17:03:30 +02:00
aclocal.m4
c99_protos.h Update copyright years. 2024-01-03 12:19:35 +01:00
ChangeLog Daily bump. 2024-06-07 00:16:38 +00:00
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021 Rotate ChangeLog files - part 1 - add ChangeLog-2021. 2022-01-03 10:18:16 +01:00
ChangeLog-2022 Rotate ChangeLog files. 2023-01-01 16:20:13 +01:00
ChangeLog-2023 Rotate ChangeLog files. 2024-01-03 11:29:39 +01:00
config.h.in libgfortran: Fix up LIBGFOR_CHECK_FLOAT128 [PR106137] 2022-06-29 17:04:50 +02:00
configure nvptx, libgfortran: Switch out of "minimal" mode 2024-06-06 13:41:47 +02:00
configure.ac nvptx, libgfortran: Switch out of "minimal" mode 2024-06-06 13:41:47 +02:00
configure.host Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
gfortran.map Fortran: Fix rejecting class arrays of different ranks as storage association argument and add un/pack_class. [PR96992] 2024-07-11 09:47:44 +02:00
ISO_Fortran_binding.h Update copyright years. 2024-01-03 12:19:35 +01:00
kinds-override.h Update copyright years. 2024-01-03 12:19:35 +01:00
libgfortran.h Fortran: Fix rejecting class arrays of different ranks as storage association argument and add un/pack_class. [PR96992] 2024-07-11 09:47:44 +02:00
libgfortran.spec.in libgfortran: avoid duplicate libraries in spec 2023-12-19 22:10:55 +01:00
libtool-version
Makefile.am Fortran: Fix rejecting class arrays of different ranks as storage association argument and add un/pack_class. [PR96992] 2024-07-11 09:47:44 +02:00
Makefile.in Fortran: Fix rejecting class arrays of different ranks as storage association argument and add un/pack_class. [PR96992] 2024-07-11 09:47:44 +02:00
mk-kinds-h.sh libgfortran: Switch some more __float128 uses to _Float128 2022-06-29 17:06:02 +02:00
mk-sik-inc.sh
mk-srk-inc.sh