------- Comment #5 from tobi at gcc dot gnu dot org  2006-05-08 12:59 -------
Wow.  This is actually a bad bug, but after trying some stuff, I believe that
it only does bad things when the code is non-standard anyway (lines beginning
with ';').

E.g.
[EMAIL PROTECTED]:~/src/pr/20440> cat t.f
      program a
      ; i = j ; end
      end
[EMAIL PROTECTED]:~/src/pr/20440> ~/src/gcc/build/gcc/f951 t.f -fdump-parse-tree

        Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4)
        procedure name = MAIN__
        symtree: MAIN__  Ambig 0
        symbol MAIN__ (UNKNOWN 0)(PROCEDURE UNKNOWN-INTENT PUBLIC UNKNOWN-PROC
SUBROUTINE)

        symtree: a  Ambig 0
        symbol a (UNKNOWN 0)(PROGRAM UNKNOWN-INTENT UNKNOWN-ACCESS
UNKNOWN-PROC)



 MAIN__
Execution times (seconds)
 final                 :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 (50%) wall   
   0 kB ( 0%) ggc
 TOTAL                 :   0.01             0.00             0.02              
 654 kB
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --disable-checking to disable checks.
[EMAIL PROTECTED]:~/src/pr/20440> 

The complete line following the semicolon is skipped.

OTOH
[EMAIL PROTECTED]:~/src/pr/20440> cat t.f
      program a
      i = j ; end
      end
[EMAIL PROTECTED]:~/src/pr/20440> ~/src/gcc/build/gcc/f951 t.f                  
 MAIN__ In file t.f:1

      program a                                                         
                                                                       1
 In file t.f:3


                   2
Error: Two main PROGRAMs at (1) and (2)

Execution times (seconds)
 parser                :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 (50%) wall   
 105 kB (16%) ggc
 TOTAL                 :   0.01             0.00             0.02              
 655 kB
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --disable-checking to disable checks.
[EMAIL PROTECTED]:~/src/pr/20440> 

yields the correct error


-- 


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

Reply via email to