aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2008-04-20 21:11:22 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2008-04-20 21:11:22 +0000
commitf449022dca52d61f2f57cb40e6fc4b9b69049314 (patch)
treeee8359090ec8ff39b18cf812acb30a1a1f72b803 /gcc
parentef5f59f6395ae2db6c02c8bed4dad9a3dd8c563d (diff)
downloadgcc-f449022dca52d61f2f57cb40e6fc4b9b69049314.zip
gcc-f449022dca52d61f2f57cb40e6fc4b9b69049314.tar.gz
gcc-f449022dca52d61f2f57cb40e6fc4b9b69049314.tar.bz2
re PR fortran/35882 (Miscounted continuation lines when interspersed with data)
2008-04-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35882 * scanner.c (skip_fixed_comments): Update continue_line when comment is detected. (gfc_next_char_literal): Likewise. PR fortran/35882 * gfortran.dg/continuation_5.f: Add some comment lines. * gfortran.dg/continuation_3.f90: Add some comment lines. From-SVN: r134493
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/scanner.c16
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/continuation_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/continuation_5.f8
5 files changed, 37 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index abcc336..78d9359 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/35882
+ * scanner.c (skip_fixed_comments): Update continue_line when comment is
+ detected. (gfc_next_char_literal): Likewise.
+
2008-04-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35944
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index dcdac64..1aa52f5 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -615,6 +615,10 @@ skip_fixed_comments (void)
!$|c$|*$ should be treated as 2 spaces if the characters
in columns 3 to 6 are valid fixed form label columns
characters. */
+ if (gfc_current_locus.lb != NULL
+ && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
+ continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
+
if (gfc_option.flag_openmp)
{
if (next_char () == '$')
@@ -700,6 +704,9 @@ skip_fixed_comments (void)
if (col != 6 && c == '!')
{
+ if (gfc_current_locus.lb != NULL
+ && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
+ continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
skip_comment_line ();
continue;
}
@@ -821,12 +828,14 @@ restart:
"statement at %C", gfc_option.max_continue_free);
}
}
- if (continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
- continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
/* Now find where it continues. First eat any comment lines. */
openmp_cond_flag = skip_free_comments ();
+ if (gfc_current_locus.lb != NULL
+ && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
+ continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
+
if (prev_openmp_flag != openmp_flag)
{
gfc_current_locus = old_loc;
@@ -945,7 +954,8 @@ restart:
}
}
- if (continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
+ if (gfc_current_locus.lb != NULL
+ && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d2435ca..a62ea30 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/35882
+ * gfortran.dg/continuation_5.f: Add some comment lines.
+ * gfortran.dg/continuation_3.f90: Add some comment lines.
+
2008-04-20 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/35960
diff --git a/gcc/testsuite/gfortran.dg/continuation_3.f90 b/gcc/testsuite/gfortran.dg/continuation_3.f90
index 238f8cc..169f06f 100644
--- a/gcc/testsuite/gfortran.dg/continuation_3.f90
+++ b/gcc/testsuite/gfortran.dg/continuation_3.f90
@@ -72,8 +72,12 @@ print *, &
"7" // & ! 27
"8" // & ! 28
"9" // & ! 29
+!
+ !
"0" // & ! 30
"1" // & ! 31
+!
+!
"2" // & ! 32
"3" // & ! 33
"4" // & ! 34
diff --git a/gcc/testsuite/gfortran.dg/continuation_5.f b/gcc/testsuite/gfortran.dg/continuation_5.f
index 15e0607..aeb2403 100644
--- a/gcc/testsuite/gfortran.dg/continuation_5.f
+++ b/gcc/testsuite/gfortran.dg/continuation_5.f
@@ -32,11 +32,19 @@
c "7" // ! 7
c "8" // ! 8
c "9" // ! 9
+!
+c
+*
+C
c "0" // ! 10
c "1" // ! 11
c "2" // ! 12
c "3" // ! 13
c "4" // ! 14
+c
+
+ !
+ !
c "5" // ! 15
c "6" // ! 16
c "7" // ! 17