diff options
| author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-12 20:04:59 +0000 |
|---|---|---|
| committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-12 20:04:59 +0000 |
| commit | a57d7269cf8aef7f1fb5f86414fe3eafba41ef30 (patch) | |
| tree | b323764db6e1598e994144a93cbef6971e5887bb | |
| parent | e4eda3ec735849d219442fd61bdb2d7fa2424e27 (diff) | |
| download | ppe42-gcc-a57d7269cf8aef7f1fb5f86414fe3eafba41ef30.tar.gz ppe42-gcc-a57d7269cf8aef7f1fb5f86414fe3eafba41ef30.zip | |
2007-07-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32634
PR fortran/32727
* module.c (write_generic): Restore patch of 2007-07-10 and use
symbol name if there are no use names.
2007-07-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32727
* gfortran.dg/interface_17.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126600 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/fortran/module.c | 19 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gfortran.dg/interface_17.f90 | 24 |
4 files changed, 54 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 151b7d979f3..79f646df955 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2007-07-12 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/32634 + PR fortran/32727 + * module.c (write_generic): Restore patch of 2007-07-10 and use + symbol name if there are no use names. + 2007-07-12 Christopher D. Rickett <crickett@lanl.gov> PR fortran/32599 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 288f1f92a35..31b7c9bbf3f 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -3947,6 +3947,9 @@ write_operator (gfc_user_op *uop) static void write_generic (gfc_symbol *sym) { + const char *p; + int nuse, j; + if (sym->generic == NULL || !gfc_check_access (sym->attr.access, sym->ns->default_access)) return; @@ -3954,7 +3957,21 @@ write_generic (gfc_symbol *sym) if (sym->module == NULL) sym->module = gfc_get_string (module_name); - mio_symbol_interface (&sym->name, &sym->module, &sym->generic); + /* See how many use names there are. If none, use the symbol name. */ + nuse = number_use_names (sym->name); + if (nuse == 0) + { + mio_symbol_interface (&sym->name, &sym->module, &sym->generic); + return; + } + + for (j = 1; j <= nuse; j++) + { + /* Get the jth local name for this symbol. */ + p = find_use_name_n (sym->name, &j); + + mio_symbol_interface (&p, &sym->module, &sym->generic); + } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc12113870e..a4f28b5e94f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-12 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/32727 + * gfortran.dg/interface_17.f90: New test. + 2007-07-12 Christopher D. Rickett <crickett@lanl.gov> PR fortran/32599 diff --git a/gcc/testsuite/gfortran.dg/interface_17.f90 b/gcc/testsuite/gfortran.dg/interface_17.f90 new file mode 100644 index 00000000000..44b8a461597 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_17.f90 @@ -0,0 +1,24 @@ +! { dg-do compile } +! Tests the fix for PR32727, which was a regression caused +! by the fix for PR32634 +! +! Contributed by Joost VandeVondele <jv244@cam.ac.uk> +! +MODULE kinds + INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND ( 14, 200 ) +END MODULE kinds + +MODULE util + USE kinds, ONLY: dp + INTERFACE sort + MODULE PROCEDURE sort2 + END INTERFACE +CONTAINS + SUBROUTINE sort2 ( ) + END SUBROUTINE sort2 +END MODULE util + +MODULE graphcon + USE util, ONLY: sort +END MODULE graphcon +! { dg-final { cleanup-modules "kinds util graphcon" } } |

