diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/oldstyle_2.f90 | 4 |
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b2926fc..a340461 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2006-07-03 Asher Langton <langton2@llnl.gov> + + * decl.c (match_old_style_init): Add data attribute to symbol. + 2006-07-03 Francois-Xavier Coudert <coudert@clipper.ens.fr> * iresolve.c (gfc_resolve_cpu_time, gfc_resolve_random_number): diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index e8b1626..5eca35d 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -385,11 +385,13 @@ match_old_style_init (const char *name) { match m; gfc_symtree *st; + gfc_symbol *sym; gfc_data *newdata; /* Set up data structure to hold initializers. */ gfc_find_sym_tree (name, NULL, 0, &st); - + sym = st->n.sym; + newdata = gfc_get_data (); newdata->var = gfc_get_data_variable (); newdata->var->expr = gfc_get_variable_expr (st); @@ -410,6 +412,13 @@ match_old_style_init (const char *name) return MATCH_ERROR; } + /* Mark the variable as having appeared in a data statement. */ + if (gfc_add_data (&sym->attr, sym->name, &sym->declared_at) == FAILURE) + { + gfc_free (newdata); + return MATCH_ERROR; + } + /* Chain in namespace list of DATA initializers. */ newdata->next = gfc_current_ns->data; gfc_current_ns->data = newdata; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 05ae56b..80a328c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2006-07-03 Asher Langton <langton2@llnl.gov> + + * gfortran.dg/oldstyle_2.f90: New. + 2006-07-03 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/gnat.dg/string_slice.adb: New test. diff --git a/gcc/testsuite/gfortran.dg/oldstyle_2.f90 b/gcc/testsuite/gfortran.dg/oldstyle_2.f90 new file mode 100644 index 0000000..6f1b477 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/oldstyle_2.f90 @@ -0,0 +1,4 @@ +! { dg-do compile} +subroutine foo(i) ! { dg-error "DATA attribute" } + integer i /10/ +end subroutine foo |