------- Comment #10 from mikael at gcc dot gnu dot org  2009-10-23 17:17 -------
(In reply to comment #9)
> Now here we may need:
> 
>           if (p == NULL)
>         {
>           skip_list ();
>           continue;
>         }
skip_list() is unnecessary here as we have parsed everything already and the
locus is on the closing parenthesis. However, mio_rparen() is needed so that we
do not miss any parenthesis (this is also the case without skip_list).
The unformatted patch should look like this (it fixes the reduced testcase, but
not tested further) :
Index: module.c
===================================================================
--- module.c    (revision 153473)
+++ module.c    (working copy)
@@ -4008,6 +4008,7 @@
          nuse = number_use_names (name, false);
          j = 1;
          p = find_use_name_n (name, &j, false);
+         if (p) {
          st = gfc_find_symtree (gfc_current_ns->sym_root, p);
          dt = st->n.sym;
          st = gfc_find_symtree (derived->f2k_derived->sym_root, name);
@@ -4019,6 +4020,7 @@
              st->n.sym = dt;
              st->n.sym->refs++;
            }
+         }
          mio_rparen ();
        }
       mio_rparen ();



> BTW, is there any good reason why 'p' is NULL?
B is not imported (or use-associated in the fortran jargon)


NB : skip_list() wouldn't work anyway because it stops when the level variable
is 0 (see the code). The character under the locus _shall_ be an opening
parenthesis at the time skip_list() is called.


-- 


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

Reply via email to