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


Toon Moene wrote:

bdavis wrote:

The problem:
     GO TO 3
   3 CONTINUE
     END



tested with no additional fortran test suite failures on i386/linux.



--bud davis


------------------------------------------------------------------------
Index: gcc/gcc/f/sta.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/sta.c,v
retrieving revision 1.11
diff -c -3 -p -r1.11 sta.c
*** 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


toon,

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 (^)


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


--bud




Index: gcc/gcc/f/sta.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/f/sta.c,v retrieving revision 1.11 diff -c -3 -p -r1.11 sta.c *** gcc/gcc/f/sta.c 17 Oct 2001 22:34:52 -0000 1.11 --- gcc/gcc/f/sta.c 21 May 2003 10:56:51 -0000 *************** ffesta_second_ (ffelexToken t) *** 954,959 **** --- 954,975 ---- ffesta_add_possible_nonexec_ ((ffelexHandler) ffestb_dummy); break;

+     case FFESTR_firstGO:
+       if ((ffelex_token_type (ffesta_token_0_) == FFELEX_typeNAMES)
+           || (ffelex_token_type (t) != FFELEX_typeNAME))
+         ffesta_add_possible_exec_ ((ffelexHandler) ffestb_goto);
+       else
+         switch (ffesta_second_kw)
+           {
+           case FFESTR_secondTO:
+             ffesta_add_possible_exec_ ((ffelexHandler) ffestb_goto);
+             break;
+           default:
+             ffesta_add_possible_exec_ ((ffelexHandler) ffestb_let);
+             break;
+           }
+       break;
+
     case FFESTR_firstGOTO:
       ffesta_add_possible_exec_ ((ffelexHandler) ffestb_goto);
       break;




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