diff options
| author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-14 13:46:05 +0000 |
|---|---|---|
| committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-14 13:46:05 +0000 |
| commit | c5157e4fff52bfc5e2169459a76698b0feb5efc7 (patch) | |
| tree | ce92f466c8f898b945fa790d876142e9a39ff6cb /gcc/fortran/match.c | |
| parent | d15dd4e9d46aabb9b720a4987962148713dacbdf (diff) | |
| download | ppe42-gcc-c5157e4fff52bfc5e2169459a76698b0feb5efc7.tar.gz ppe42-gcc-c5157e4fff52bfc5e2169459a76698b0feb5efc7.zip | |
fortran:
PR fortran/14066
* match.c (gfc_match_do): Allow infinite loops with
label-do-stmt. Do not enforce space after comma.
testsuite:
PR fortran/14066
* gfortran.fortran-torture/compile/do_1.f90: New test.
Also fixed date on previous ChangeLog entries.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81842 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/match.c')
| -rw-r--r-- | gcc/fortran/match.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 28fe7a60e1e..fc5afbfcc5d 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1203,6 +1203,10 @@ gfc_match_do (void) if (gfc_match (" do") != MATCH_YES) return MATCH_NO; + m = gfc_match_st_label (&label, 0); + if (m == MATCH_ERROR) + goto cleanup; + /* Match an infinite DO, make it like a DO WHILE(.TRUE.) */ if (gfc_match_eos () == MATCH_YES) @@ -1212,13 +1216,9 @@ gfc_match_do (void) goto done; } - m = gfc_match_st_label (&label, 0); - if (m == MATCH_ERROR) - goto cleanup; - - gfc_match_char (','); - - if (gfc_match ("% ") != MATCH_YES) + /* match an optional comma, if no comma is found a space is obligatory. */ + if (gfc_match_char(',') != MATCH_YES + && gfc_match ("% ") != MATCH_YES) return MATCH_NO; /* See if we have a DO WHILE. */ |

