-
- Downloads
Fortran: Various CLASS + assumed-rank fixed [PR102541]
Starting point was PR102541, were a previous patch caused an invalid e->ref access for class. When testing, it turned out that for CLASS to CLASS the code was never executed - additionally, issues appeared for optional and a bogus error for -fcheck=all. In particular: There were a bunch of issues related to optional CLASS, can have the 'attr.dummy' set in CLASS_DATA (sym) - but sometimes also in 'sym'!?! Additionally, gfc_variable_attr could return pointer = 1 for nonpointers when the expr is no longer "var" but "var%_data". PR fortran/102541 gcc/fortran/ChangeLog: * check.c (gfc_check_present): Handle optional CLASS. * interface.c (gfc_compare_actual_formal): Likewise. * trans-array.c (gfc_trans_g77_array): Likewise. * trans-decl.c (gfc_build_dummy_array_decl): Likewise. * trans-types.c (gfc_sym_type): Likewise. * primary.c (gfc_variable_attr): Fixes for dummy and pointer when 'class%_data' is passed. * trans-expr.c (set_dtype_for_unallocated, gfc_conv_procedure_call): For assumed-rank dummy, fix setting rank for dealloc/notassoc actual and setting ubound to -1 for assumed-size actuals. gcc/testsuite/ChangeLog: * gfortran.dg/assumed_rank_24.f90: New test.
Showing
- gcc/fortran/check.c 3 additions, 1 deletiongcc/fortran/check.c
- gcc/fortran/interface.c 7 additions, 2 deletionsgcc/fortran/interface.c
- gcc/fortran/primary.c 13 additions, 4 deletionsgcc/fortran/primary.c
- gcc/fortran/trans-array.c 3 additions, 1 deletiongcc/fortran/trans-array.c
- gcc/fortran/trans-decl.c 2 additions, 1 deletiongcc/fortran/trans-decl.c
- gcc/fortran/trans-expr.c 42 additions, 38 deletionsgcc/fortran/trans-expr.c
- gcc/fortran/trans-types.c 2 additions, 1 deletiongcc/fortran/trans-types.c
- gcc/testsuite/gfortran.dg/assumed_rank_24.f90 137 additions, 0 deletionsgcc/testsuite/gfortran.dg/assumed_rank_24.f90
Loading
Please register or sign in to comment