re PR fortran/64589 ([OOP] Linking error due to undefined integer symbol with unlimit...
authorAndre Vehreschild <vehre@gcc.gnu.org>
Mon, 13 Jul 2015 09:01:54 +0000 (11:01 +0200)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Mon, 13 Jul 2015 09:01:54 +0000 (11:01 +0200)
gcc/testsuite/ChangeLog:

2015-07-13  Andre Vehreschild  <vehre@gcc.gnu.org>

PR fortran/64589
* gfortran.dg/pr64589.f90: New test.

gcc/fortran/ChangeLog:

2015-07-13  Andre Vehreschild  <vehre@gcc.gnu.org>

PR fortran/64589
* class.c (find_intrinsic_vtab): Put/Search vtabs for intrinsic
types in the top-level namespace.

From-SVN: r225730

gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr64589.f90 [new file with mode: 0644]

index 6fad33241df5598696aa602bc30c40c7d6836c24..0a2734b66952daf2b6d448555537a29c5a53a4a2 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-13  Andre Vehreschild  <vehre@gcc.gnu.org>
+
+       PR fortran/64589
+       * class.c (find_intrinsic_vtab): Put/Search vtabs for intrinsic
+       types in the top-level namespace.
+
 2015-07-12  Aldy Hernandez  <aldyh@redhat.com>
 
        * trans-stmt.c: Fix double word typos.
index 799039999db4b4a80ac111e70342182d5c3f38d9..218973dc048b27522f42a673dbf89bddceb03943 100644 (file)
@@ -2511,10 +2511,8 @@ find_intrinsic_vtab (gfc_typespec *ts)
 
       sprintf (name, "__vtab_%s", tname);
 
-      /* Look for the vtab symbol in various namespaces.  */
-      gfc_find_symbol (name, gfc_current_ns, 0, &vtab);
-      if (vtab == NULL)
-       gfc_find_symbol (name, ns, 0, &vtab);
+      /* Look for the vtab symbol in the top-level namespace only.  */
+      gfc_find_symbol (name, ns, 0, &vtab);
 
       if (vtab == NULL)
        {
index 1e6a07186d6314e85ae3d10d8929313b0d3edbf3..46cf748e298c3f3d99dd4d53797e70419fca4dd9 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-13  Andre Vehreschild  <vehre@gcc.gnu.org>
+
+       PR fortran/64589
+       * gfortran.dg/pr64589.f90: New test.
+
 2015-07-13  Renlin Li  <renlin.li@arm.com>
 
        PR rtl/66556
diff --git a/gcc/testsuite/gfortran.dg/pr64589.f90 b/gcc/testsuite/gfortran.dg/pr64589.f90
new file mode 100644 (file)
index 0000000..6e65e70
--- /dev/null
@@ -0,0 +1,30 @@
+! { dg-do compile }
+! Just need to check if compiling and linking is possible.
+!
+! Check that the _vtab linking issue is resolved.
+! Contributed by Damian Rouson  <damian@sourceryinstitute.org>
+
+module m
+contains
+  subroutine fmt()
+    class(*), pointer :: arg
+    select type (arg)
+    type is (integer)
+    end select
+  end subroutine
+end module
+
+program p
+  call getSuffix()
+contains
+  subroutine makeString(arg1)
+    class(*) :: arg1
+    select type (arg1)
+    type is (integer)
+    end select
+  end subroutine
+  subroutine getSuffix()
+    call makeString(1)
+  end subroutine
+end
+