+2010-08-04 Mikael Morin <mikael@gcc.gnu.org>
+
+ 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 <burnus@net-b.de>
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
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);
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. */
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. */
{
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. */
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. */
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;
gfc_gsymbol *gfc_gsym_root = NULL;
-gfc_symbol *changed_syms = NULL;
+static gfc_symbol *changed_syms = NULL;
gfc_dt_list *gfc_derived_types;
/* Decrease the reference counter and free memory when we reach zero. */
+
void
gfc_release_symbol (gfc_symbol *sym)
{
}
-#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 ************/