aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-decl.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_39.f9020
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" } }