From d95efb59134083b64690a1e60699581625a4afc2 Mon Sep 17 00:00:00 2001 From: pault Date: Sun, 20 Aug 2006 05:45:43 +0000 Subject: 2006-08-20 Paul Thomas PR fortran/28601 PR fortran/28630 * gfortran.h : Eliminate gfc_dt_list structure and reference to it in gfc_namespace. * resolve.c (resolve_fl_derived): Remove the building of the list of derived types for the current namespace. * symbol.c (find_renamed_type): New function to find renamed derived types by symbol name rather than symtree name. (gfc_use_derived): Search parent namespace for identical derived type and use it, even if local version is complete, except in interface bodies. Ensure that renamed derived types are found by call to find_renamed_type. Recurse for derived type components. (gfc_free_dt_list): Remove. (gfc_free_namespace): Remove call to previous. * trans-types.c (copy_dt_decls_ifequal): Remove. (gfc_get_derived_type): Remove all the paraphenalia for association of derived types, including calls to previous. * match.c (gfc_match_allocate): Call gfc_use_derived to associate any derived types that are being allocated. PR fortran/20886 * resolve.c (resolve_actual_arglist): The passing of a generic procedure name as an actual argument is an error. PR fortran/28735 * resolve.c (resolve_variable): Check for a symtree before resolving references. PR fortran/28762 * primary.c (match_variable): Return MATCH_NO if the symbol is that of the program. PR fortran/28425 * trans-expr.c (gfc_trans_subcomponent_assign): Translate derived type component expressions other than another derived type constructor. PR fortran/28496 * expr.c (find_array_section): Correct errors in the handling of a missing start value for the index triplet in an array reference. PR fortran/18111 * trans-decl.c (gfc_build_dummy_array_decl): Before resetting reference to backend_decl, set it DECL_ARTIFICIAL. (gfc_get_symbol_decl): Likewise for original dummy decl, when a copy is made of an array. (create_function_arglist): Likewise for the _entry paramter in entry_masters. (build_entry_thunks): Likewise for dummies in entry thunks. PR fortran/28600 * trans-decl.c (gfc_get_symbol_decl): Ensure that the DECL_CONTEXT of the length of a character dummy is the same as that of the symbol declaration. PR fortran/28771 * decl.c (add_init_expr_to_sym): Remove setting of charlen for an initializer of an assumed charlen variable. PR fortran/28660 * trans-decl.c (generate_expr_decls): New function. (generate_dependency_declarations): New function. (generate_local_decl): Call previous if not either a dummy or a declaration in an entry master. 2006-08-20 Paul Thomas PR fortran/28630 * gfortran.dg/used_types_2.f90: New test. PR fortran/28601 * gfortran.dg/used_types_3.f90: New test. PR fortran/20886 * gfortran.dg/generic_actual_arg.f90: New test. PR fortran/28735 * gfortran.dg/module_private_array_refs_1.f90: New test. PR fortran/28762 * gfortran.dg/program_name_1.f90: New test. PR fortran/28425 * gfortran.dg/derived_constructor_comps_1.f90: New test. PR fortran/28496 * gfortran.dg/array_initializer_2.f90: New test. PR fortran/18111 * gfortran.dg/unused_artificial_dummies_1.f90: New test. PR fortran/28600 * gfortran.dg/assumed_charlen_function_4.f90: New test. PR fortran/28771 * gfortran.dg/assumed_charlen_in_main.f90: New test. PR fortran/28660 * gfortran.dg/dependent_decls_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116268 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/expr.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gcc/fortran/expr.c') diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 4b037983616..b1f064d0720 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -1014,6 +1014,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) int rank; int d; long unsigned one = 1; + mpz_t start[GFC_MAX_DIMENSIONS]; mpz_t end[GFC_MAX_DIMENSIONS]; mpz_t stride[GFC_MAX_DIMENSIONS]; mpz_t delta[GFC_MAX_DIMENSIONS]; @@ -1052,6 +1053,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) for (d = 0; d < rank; d++) { mpz_init (delta[d]); + mpz_init (start[d]); mpz_init (end[d]); mpz_init (ctr[d]); mpz_init (stride[d]); @@ -1085,15 +1087,16 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) mpz_set_ui (stride[d], one); /* Obtain the start value for the index. */ - if (begin->value.integer) - mpz_set (ctr[d], begin->value.integer); + if (begin) + mpz_set (start[d], begin->value.integer); else { if (mpz_cmp_si (stride[d], 0) < 0) - mpz_set (ctr[d], upper->value.integer); + mpz_set (start[d], upper->value.integer); else - mpz_set (ctr[d], lower->value.integer); + mpz_set (start[d], lower->value.integer); } + mpz_set (ctr[d], start[d]); /* Obtain the end value for the index. */ if (finish) @@ -1171,7 +1174,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) if (mpz_cmp_ui (stride[d], 0) > 0 ? mpz_cmp (ctr[d], tmp_mpz) > 0 : mpz_cmp (ctr[d], tmp_mpz) < 0) - mpz_set (ctr[d], ref->u.ar.start[d]->value.integer); + mpz_set (ctr[d], start[d]); else mpz_set_ui (stop, 0); } @@ -1205,6 +1208,7 @@ cleanup: for (d = 0; d < rank; d++) { mpz_clear (delta[d]); + mpz_clear (start[d]); mpz_clear (end[d]); mpz_clear (ctr[d]); mpz_clear (stride[d]); -- cgit v1.2.3