Patchwork [fortran] PR42051 take 2

login
register
mail settings
Submitter Mikael Morin
Date July 30, 2010, 5:06 p.m.
Message ID <4C53067F.8060202@sfr.fr>
Download mbox | patch
Permalink /patch/60370/
State New
Headers show

Comments

Mikael Morin - July 30, 2010, 5:06 p.m.
Hello,

I was a bit dissatisfied by the fact that the testcase committed with 
the PR42051 fix may well not trigger in the case of the regression.

This patch adds a sanity check to make it trigger.

I will commit under the obvious rule once regression test is done.

Mikael.
2010-07-30  Mikael Morin  <mikael@gcc.gnu.org>

	* symbol.c (changed_syms): Made non-static.
	* parse.c (changed_syms): declare
	(next_statement): Assert changed_syms is NULL at the beginning.
H.J. Lu - July 31, 2010, 3:34 p.m.
On Fri, Jul 30, 2010 at 10:06 AM, Mikael Morin <mikael.morin@sfr.fr> wrote:
> Hello,
>
> I was a bit dissatisfied by the fact that the testcase committed with the
> PR42051 fix may well not trigger in the case of the regression.
>
> This patch adds a sanity check to make it trigger.
>
> I will commit under the obvious rule once regression test is done.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45151

Is this a known bug?

Patch

Index: symbol.c
===================================================================
--- symbol.c	(revision 162719)
+++ symbol.c	(working copy)
@@ -98,7 +98,7 @@  gfc_namespace *gfc_global_ns_list;
 
 gfc_gsymbol *gfc_gsym_root = NULL;
 
-static gfc_symbol *changed_syms = NULL;
+gfc_symbol *changed_syms = NULL;
 
 gfc_dt_list *gfc_derived_types;
 
Index: parse.c
===================================================================
--- parse.c	(revision 162719)
+++ parse.c	(working copy)
@@ -879,6 +879,7 @@  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.  */
@@ -889,6 +890,9 @@  next_statement (void)
   gfc_statement st;
   locus old_locus;
 
+  /* We start with a clean state.  */
+  gcc_assert (changed_syms == NULL);
+
   gfc_new_block = NULL;
 
   gfc_current_ns->old_cl_list = gfc_current_ns->cl_list;