From: Mikael Morin Date: Wed, 4 Aug 2010 14:17:31 +0000 (+0000) Subject: re PR fortran/42051 ([OOP] ICE on array-valued function with CLASS formal argument) X-Git-Tag: upstream/12.2.0~91114 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bc20f3a3f95e0aceb4800fb3992d9eeec41b199;p=platform%2Fupstream%2Fgcc.git re PR fortran/42051 ([OOP] ICE on array-valued function with CLASS formal argument) 2010-08-04 Mikael Morin PR fortran/42051 PR fortran/44064 * symbol.c (changed_syms): Made static again. (gfc_symbol_state): Don't conditionalize on GFC_DEBUG. Changed conditional internal error into assert. Rename function to ... (gfc_enforce_clean_symbol_state): ... this. * gfortran.h (gfc_symbol_state, gfc_enforce_clean_symbol_state): Rename the former to the latter. * parse.c (decode_statement, decode_omp_directive, decode_gcc_attribute): Update callers accordingly. Don't conditionalize on GFC_DEBUG. (changed_syms): Remove declaration. (next_statement): Use gfc_enforce_clean_symbol_state. From-SVN: r162865 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 30a9415..ecf0ff2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,8 +1,25 @@ +2010-08-04 Mikael Morin + + PR fortran/42051 + PR fortran/44064 + * symbol.c (changed_syms): Made static again. + (gfc_symbol_state): Don't conditionalize on GFC_DEBUG. + Changed conditional internal error into assert. + Rename function to ... + (gfc_enforce_clean_symbol_state): ... this. + * gfortran.h (gfc_symbol_state, gfc_enforce_clean_symbol_state): + Rename the former to the latter. + * parse.c (decode_statement, decode_omp_directive, + decode_gcc_attribute): Update callers accordingly. Don't conditionalize + on GFC_DEBUG. + (changed_syms): Remove declaration. + (next_statement): Use gfc_enforce_clean_symbol_state. + 2010-08-04 Tobias Burnus PR fortran/44857 * resolve.c (resolve_structure_cons): Fix handling of - initialization structcture constructors with character + initialization structure constructors with character elements of the wrong length. * array.c (gfc_check_iter_variable): Add NULL check. (gfc_resolve_character_array_constructor): Also truncate diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index d623d0d..713533d 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2557,7 +2557,7 @@ void gfc_traverse_ns (gfc_namespace *, void (*)(gfc_symbol *)); void gfc_traverse_user_op (gfc_namespace *, void (*)(gfc_user_op *)); void gfc_save_all (gfc_namespace *); -void gfc_symbol_state (void); +void gfc_enforce_clean_symbol_state (void); void gfc_free_dt_list (void); diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index d65ff1f..c7f55c9 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -236,9 +236,7 @@ decode_statement (void) match m; char c; -#ifdef GFC_DEBUG - gfc_symbol_state (); -#endif + gfc_enforce_clean_symbol_state (); gfc_clear_error (); /* Clear any pending errors. */ gfc_clear_warning (); /* Clear any pending warnings. */ @@ -484,9 +482,7 @@ decode_omp_directive (void) locus old_locus; char c; -#ifdef GFC_DEBUG - gfc_symbol_state (); -#endif + gfc_enforce_clean_symbol_state (); gfc_clear_error (); /* Clear any pending errors. */ gfc_clear_warning (); /* Clear any pending warnings. */ @@ -588,9 +584,7 @@ decode_gcc_attribute (void) { locus old_locus; -#ifdef GFC_DEBUG - gfc_symbol_state (); -#endif + gfc_enforce_clean_symbol_state (); gfc_clear_error (); /* Clear any pending errors. */ gfc_clear_warning (); /* Clear any pending warnings. */ @@ -879,7 +873,6 @@ blank_line: return ST_NONE; } -extern gfc_symbol *changed_syms; /* Return the next non-ST_NONE statement to the caller. We also worry about including files and the ends of include files at this stage. */ @@ -890,8 +883,7 @@ next_statement (void) gfc_statement st; locus old_locus; - /* We start with a clean state. */ - gcc_assert (changed_syms == NULL); + gfc_enforce_clean_symbol_state (); gfc_new_block = NULL; diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index a4d0ec3..87e94e7 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -98,7 +98,7 @@ gfc_namespace *gfc_global_ns_list; gfc_gsymbol *gfc_gsym_root = NULL; -gfc_symbol *changed_syms = NULL; +static gfc_symbol *changed_syms = NULL; gfc_dt_list *gfc_derived_types; @@ -2503,6 +2503,7 @@ gfc_free_symbol (gfc_symbol *sym) /* Decrease the reference counter and free memory when we reach zero. */ + void gfc_release_symbol (gfc_symbol *sym) { @@ -3442,16 +3443,13 @@ gfc_save_all (gfc_namespace *ns) } -#ifdef GFC_DEBUG /* Make sure that no changes to symbols are pending. */ void -gfc_symbol_state(void) { - - if (changed_syms != NULL) - gfc_internal_error("Symbol changes still pending!"); +gfc_enforce_clean_symbol_state(void) +{ + gcc_assert (changed_syms == NULL); } -#endif /************** Global symbol handling ************/