diff options
author | Janus Weil <janus@gcc.gnu.org> | 2012-12-11 00:17:43 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2012-12-11 00:17:43 +0100 |
commit | 5e4404b8084a1e087c623da575560e940a47db81 (patch) | |
tree | 5bfdad9fb7c546dac5cf3a2813a3cc904848926b /gcc | |
parent | c6f0bffeb37be648d2d3d30bcc6c48d575a96755 (diff) | |
download | gcc-5e4404b8084a1e087c623da575560e940a47db81.zip gcc-5e4404b8084a1e087c623da575560e940a47db81.tar.gz gcc-5e4404b8084a1e087c623da575560e940a47db81.tar.bz2 |
re PR fortran/52909 ([F03] Procedure pointers not private to modules)
2012-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/52909
* trans-decl.c (get_proc_pointer_decl): Apply name mangling.
2012-12-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/52909
* gfortran.dg/proc_ptr_39.f90: New test case.
From-SVN: r194375
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/proc_ptr_39.f90 | 20 |
4 files changed, 38 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index aa9eb9f..a067787 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2012-12-10 Janus Weil <janus@gcc.gnu.org> + + PR fortran/52909 + * trans-decl.c (get_proc_pointer_decl): Apply name mangling. + 2012-12-09 Tobias Burnus <burnus@net-b.de> * trans-array.c (gfc_deallocate_scalar_with_status): Use diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index b236050..dbc5a10 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1531,6 +1531,14 @@ get_proc_pointer_decl (gfc_symbol *sym) VAR_DECL, get_identifier (sym->name), build_pointer_type (gfc_get_function_type (sym))); + if (sym->module) + { + /* Apply name mangling. */ + gfc_set_decl_assembler_name (decl, gfc_sym_mangled_identifier (sym)); + if (sym->attr.use_assoc) + DECL_IGNORED_P (decl) = 1; + } + if ((sym->ns->proc_name && sym->ns->proc_name->backend_decl == current_function_decl) || sym->attr.contained) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ab94599..481bbaa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-12-10 Janus Weil <janus@gcc.gnu.org> + + PR fortran/52909 + * gfortran.dg/proc_ptr_39.f90: New test case. + 2012-12-10 Richard Sandiford <rdsandiford@googlemail.com> * gcc.target/mips/octeon-bbit-2.c: Restructure loops so that no diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_39.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_39.f90 new file mode 100644 index 0000000..6eb0f15 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_39.f90 @@ -0,0 +1,20 @@ +! { dg-do compile } +! +! PR 52909: [F03] Procedure pointers not private to modules +! +! Contributed by Andrew Benson <abenson@caltech.edu> + +module Module1 + procedure(), pointer, private :: procPtr => null() +end module + +module Module2 + procedure(), pointer, private :: procPtr => null() +end module + +program Test + use Module1 + use Module2 +end program + +! { dg-final { cleanup-modules "Module1 Module2" } } |