aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog10
-rw-r--r--gcc/fortran/match.c11
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/nullify_2.f907
4 files changed, 29 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 517535b..80a453d 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,13 @@
+2006-02-02 Steven G. Kargl <kargls@comcast>
+
+ PR fortran/24958
+ match.c (gfc_match_nullify): Free the list from head not tail.
+
+ PR fortran/25072
+ * match.c (match_forall_header): Fix internal error caused by bogus
+ gfc_epxr pointers.
+
+
2006-01-31 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/26039
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 40355d2..f726224 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -1890,7 +1890,7 @@ syntax:
gfc_syntax_error (ST_NULLIFY);
cleanup:
- gfc_free_statements (tail);
+ gfc_free_statements (new_st.next);
return MATCH_ERROR;
}
@@ -3367,12 +3367,13 @@ static match
match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask)
{
gfc_forall_iterator *head, *tail, *new;
+ gfc_expr *msk;
match m;
gfc_gobble_whitespace ();
head = tail = NULL;
- *mask = NULL;
+ msk = NULL;
if (gfc_match_char ('(') != MATCH_YES)
return MATCH_NO;
@@ -3393,6 +3394,7 @@ match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask)
m = match_forall_iterator (&new);
if (m == MATCH_ERROR)
goto cleanup;
+
if (m == MATCH_YES)
{
tail->next = new;
@@ -3402,7 +3404,7 @@ match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask)
/* Have to have a mask expression */
- m = gfc_match_expr (mask);
+ m = gfc_match_expr (&msk);
if (m == MATCH_NO)
goto syntax;
if (m == MATCH_ERROR)
@@ -3415,13 +3417,14 @@ match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask)
goto syntax;
*phead = head;
+ *mask = msk;
return MATCH_YES;
syntax:
gfc_syntax_error (ST_FORALL);
cleanup:
- gfc_free_expr (*mask);
+ gfc_free_expr (msk);
gfc_free_forall_iterator (head);
return MATCH_ERROR;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5d4cff5..217aad8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-02 Steven G. Kargl <kargls@comcast>
+
+ PR fortran/24958
+ gfortran.dg/nullify_2.f90: New test.
+
2006-02-02 Diego Novillo <dnovillo@redhat.com>
PR 25990
diff --git a/gcc/testsuite/gfortran.dg/nullify_2.f90 b/gcc/testsuite/gfortran.dg/nullify_2.f90
new file mode 100644
index 0000000..ebfcb37
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/nullify_2.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/25146
+program i
+ implicit none
+ TYPE (a) t1 ! { dg-error "is being used before" }
+ nullify(t1%x) ! { dg-error "error in NULLIFY" }
+end program