summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 19:21:07 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 19:21:07 +0000
commit44a4c8df3bff6cbdb8631f06496843d8c3f5ebbc (patch)
treebe5d340359c9c2457ac41df644cd231c22fd145e
parent9f596ec0eebfd0b7dbcb0d22972171d780f3a2b7 (diff)
downloadgcc-44a4c8df3bff6cbdb8631f06496843d8c3f5ebbc.tar.gz
fortran/
PR fortran/26277 * io.c (match_ltag): Mark label as referenced. testsuite/ PR fortran/26277 * gfortran.dg/label_4.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110993 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/io.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/label_4.f908
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 7a36057a8f2..faf6975e2df 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-14 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/26277
+ * io.c (match_ltag): Mark label as referenced.
+
2006-02-14 Jakub Jelinek <jakub@redhat.com>
Richard Henderson <rth@redhat.com>
Diego Novillo <dnovillo@redhat.com>
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index c88c74a7d23..618d056ce79 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -972,6 +972,10 @@ match_ltag (const io_tag * tag, gfc_st_label ** label)
return MATCH_ERROR;
}
+ if (m == MATCH_YES
+ && gfc_reference_st_label (*label, ST_LABEL_TARGET) == FAILURE)
+ return MATCH_ERROR;
+
return m;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d12f8741c62..cb15ef61fec 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-14 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/26277
+ * gfortran.dg/label_4.f90: New.
+
2006-02-14 Jakub Jelinek <jakub@redhat.com>
Diego Novillo <dnovillo@redhat.com>
Uros Bizjak <uros@kss-loka.si>
diff --git a/gcc/testsuite/gfortran.dg/label_4.f90 b/gcc/testsuite/gfortran.dg/label_4.f90
new file mode 100644
index 00000000000..68b2291fbea
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/label_4.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! { dg-options "-Wunused-labels" }
+! PR 26277
+! We used to give an incorect warning about label 99 not being referenced
+ open(unit=12,err=99)
+99 print *,"could not open file ..."
+98 continue ! { dg-warning "Label 98 .* defined but not used" }
+end