diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2024-06-20 08:01:36 +0100 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2024-06-20 08:01:36 +0100 |
commit | ccaa39a268bef2a1d8880022696ff2dcaa6af941 (patch) | |
tree | fc4dec85138e2edc6ae85f0e3c705ac3d9ea175b /gcc/ada/debug.adb | |
parent | 46bb4ce4d30ab749d40f6f4cef6f1fb7c7813452 (diff) | |
download | gcc-ccaa39a268bef2a1d8880022696ff2dcaa6af941.zip gcc-ccaa39a268bef2a1d8880022696ff2dcaa6af941.tar.gz gcc-ccaa39a268bef2a1d8880022696ff2dcaa6af941.tar.bz2 |
Fortran: Auto array allocation with function dependencies [PR59104]
2024-06-20 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/59104
* dependency.cc (dependency_fcn, gfc_function_dependency): New
functions to detect dependency in array bounds and character
lengths on old style function results.
* dependency.h : Add prototype for gfc_function_dependency.
* error.cc (error_print): Remove trailing space.
* gfortran.h : Remove dummy_order and add fn_result_spec.
* symbol.cc : Remove declaration of next_dummy_order..
(gfc_set_sym_referenced): remove setting of symbol dummy order.
* trans-array.cc (gfc_trans_auto_array_allocation): Detect
non-dummy symbols with function dependencies and put the
allocation at the end of the initialization code.
* trans-decl.cc : Include dependency.h.
(decl_order): New function that determines uses the location
field of the symbol 'declared_at' to determine the order of two
declarations.
(gfc_defer_symbol_init): Call gfc_function_dependency to put
dependent symbols in the right part of the tlink chain. Use
the location field of the symbol declared_at to determine the
order of declarations.
(gfc_trans_auto_character_variable): Put character length
initialization of dependent symbols at the end of the chain.
* trans.cc (gfc_add_init_cleanup): Add boolean argument with
default false that determines whther an expression is placed at
the back or the front of the initialization chain.
* trans.h : Update the prototype for gfc_add_init_cleanup.
gcc/testsuite/
PR fortran/59104
* gfortran.dg/dependent_decls_2.f90: New test.
Diffstat (limited to 'gcc/ada/debug.adb')
0 files changed, 0 insertions, 0 deletions