diff options
author | Asher Langton <langton2@llnl.gov> | 2006-07-03 20:19:23 +0000 |
---|---|---|
committer | Asher Langton <langton@gcc.gnu.org> | 2006-07-03 20:19:23 +0000 |
commit | ed0e3607b2a4fa5fbba08eafc2d8bb24ab593c95 (patch) | |
tree | 46b4a61a47ef5f0387caa05bed0d5eba599c7308 /gcc | |
parent | 11fc42759850498a535a03418e667a57461fab91 (diff) | |
download | gcc-ed0e3607b2a4fa5fbba08eafc2d8bb24ab593c95.zip gcc-ed0e3607b2a4fa5fbba08eafc2d8bb24ab593c95.tar.gz gcc-ed0e3607b2a4fa5fbba08eafc2d8bb24ab593c95.tar.bz2 |
decl.c (match_old_style_init): Add data attribute to symbol.
* decl.c (match_old_style_init): Add data attribute to symbol.
* gfortran.dg/oldstyle_2.f90: New.
From-SVN: r115161
Diffstat (limited to 'gcc')
-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 |