This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FORTAN: PATCH FOR PR #10843


Bud Davis wrote:

Toon Moene wrote:

bdavis wrote:

The problem:
     GO TO 3
   3 CONTINUE
     END

*** gcc/gcc/f/sta.c     17 Oct 2001 22:34:52 -0000      1.11
--- gcc/gcc/f/sta.c     18 May 2003 22:15:05 -0000
*************** ffesta_second_ (ffelexToken t)
*** 954,959 ****
--- 954,960 ----
       ffesta_add_possible_nonexec_ ((ffelexHandler) ffestb_dummy);
       break;

+     case FFESTR_firstGO:
     case FFESTR_firstGOTO:
       ffesta_add_possible_exec_ ((ffelexHandler) ffestb_goto);
       break;

It's more complicated than that - you have to make sure that it's actually followed by "TO". See somewhat more to the beginning of the function on how to handle that - FFESTR_firstEND

i am not sure where to go when the first token is a GO and the second not a TO. calling it an assignment statement seemed like a good idea, but the error message is less then ideal :


this code

      GO NAME
1     CONTINUE
      END

gives this diagnostic

g.f: In program `MAIN__':
g.f:1:
         GO NAME
            ^
Invalid form for assignment statement at (^)


With the current implementation it gives:


GO NAME
1 2
Unrecognized statement name at (1) and invalid form for assignment or statement-function definition at (2)


which is not that much more clear.

maybe calling it a possible goto (ffesta_add_possible_exec_ ((ffelexHandler) ffestb_goto);) is the right way to go ?

Yes, please try that and see what happens.


Thanks for your debugging and testing work !

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]