From: Tobias Schlüter Date: Wed, 15 Dec 2004 18:55:57 +0000 (+0100) Subject: re PR fortran/18993 (incorrect parsing in fixed-form) X-Git-Tag: releases/gcc-4.0.0~2137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=172b87995cadacf87ba6ce1517b8a49acc3db0ae;p=thirdparty%2Fgcc.git re PR fortran/18993 (incorrect parsing in fixed-form) fortran/ PR fortran/18993 * match.c (gfc_match_if): Don't explicitly skip optional whitespace. (gfc_match_nullify): Make sure that ')' is in front of the end of statement. testsuite/ PR fortran/18993 * gfotran.dg/nullify_1.f: New test. From-SVN: r92209 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b701dc940682..e3b22558a44a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2004-12-15 Tobias Schlueter + + PR fortran/18993 + * match.c (gfc_match_if): Don't explicitly skip optional whitespace. + (gfc_match_nullify): Make sure that ')' is in front of the end of + statement. + 2004-12-14 Richard Henderson * gfortran.h (gfc_expr.function.name): Make const. diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index cf0c255524de..825120f5ca98 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -974,7 +974,7 @@ gfc_match_if (gfc_statement * if_type) return MATCH_YES; } - if (gfc_match (" then %t") == MATCH_YES) + if (gfc_match (" then%t") == MATCH_YES) { new_st.op = EXEC_IF; new_st.expr = expr; @@ -1822,7 +1822,7 @@ gfc_match_nullify (void) tail->expr = p; tail->expr2 = e; - if (gfc_match_char (')') == MATCH_YES) + if (gfc_match (" )%t") == MATCH_YES) break; if (gfc_match_char (',') != MATCH_YES) goto syntax; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 449213da5ac5..58d4e787d15e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-12-15 Tobias Schlueter + + PR fortran/18993 + * gfotran.dg/nullify_1.f: New test. + 2004-12-15 Richard Henderson * gcc.target/i386/i386.exp: New harness. diff --git a/gcc/testsuite/gfortran.dg/nullify_1.f b/gcc/testsuite/gfortran.dg/nullify_1.f new file mode 100644 index 000000000000..abf68c969ba9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/nullify_1.f @@ -0,0 +1,11 @@ +C { dg-do compile } +C PR 18993 +C we didn't match the end of statement following NULLIFY () +C this lead to weird error messages + subroutine ordern( ) + real, pointer :: aux(:,:) +C Nullify pointers + nullify(aux) +C Set default sizes for order N arrays + end subroutine ordern +