summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-15 16:30:52 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-15 16:30:52 +0000
commit5aed5db309a564ee459385e9d85d5d0751d52c88 (patch)
tree2ee9a5e258ea7946f8f29aa839fb77c92adbaa72
parenta8741763fefc073956c6b1d09b56a737bd367394 (diff)
downloadgcc-5aed5db309a564ee459385e9d85d5d0751d52c88.tar.gz
2006-09-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29051 * decl.c (match_old_style_init): Set the 'where' field of the gfc_data structure 'newdata'. * match.c (match_case_eos): Add a comprehensible error message. 2006-09-15 Paul Thomas <pault@gcc.gnu.org> PR fortran/29051 * gfortran.dg/oldstyle_3.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116977 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/decl.c1
-rw-r--r--gcc/fortran/match.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/oldstyle_3.f9010
5 files changed, 28 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 2e88fbf8b3e..371860a95e8 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2006-09-15 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29051
+ * decl.c (match_old_style_init): Set the 'where' field of the
+ gfc_data structure 'newdata'.
+
+ * match.c (match_case_eos): Add a comprehensible error message.
+
2006-09-13 Wolfgang Gellerich <gellerich@de.ibm.com>
* trans-expr.c (gfc_add_interface_mapping): For characters, dereference
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 19bf1b0ee76..6045b204663 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -395,6 +395,7 @@ match_old_style_init (const char *name)
newdata = gfc_get_data ();
newdata->var = gfc_get_data_variable ();
newdata->var->expr = gfc_get_variable_expr (st);
+ newdata->where = gfc_current_locus;
/* Match initial value list. This also eats the terminal
'/'. */
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index d90fc473210..3f393856798 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -3056,7 +3056,10 @@ match_case_eos (void)
/* If the case construct doesn't have a case-construct-name, we
should have matched the EOS. */
if (!gfc_current_block ())
- return MATCH_ERROR;
+ {
+ gfc_error ("Expected the name of the select case construct at %C");
+ return MATCH_ERROR;
+ }
gfc_gobble_whitespace ();
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0e52fad14c5..d2cb97d59c3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-15 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29051
+ * gfortran.dg/oldstyle_3.f90: New test.
+
2006-09-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29099
diff --git a/gcc/testsuite/gfortran.dg/oldstyle_3.f90 b/gcc/testsuite/gfortran.dg/oldstyle_3.f90
new file mode 100644
index 00000000000..dad69568b51
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/oldstyle_3.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! Suppress the warning about an old-style initializer;
+! { dg-options "" }
+! This tests the fix for PR29052 in which the error below would cause a seg-fault
+! because the locus of the initializer was never set.
+!
+! Contributed by Bud Davis <bdavis@gcc.gnu.org>
+!
+ character*10 a(4,2) /'aaa','bbb','ccc','ddd'/ ! { dg-error "more variables than values" }
+ end