re PR target/34435 (SSE2 intrinsics - emmintrin with optimisations off and type conve...
authorPaul Thomas <pault@gcc.gnu.org>
Thu, 6 Dec 2007 06:11:01 +0000 (06:11 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Thu, 6 Dec 2007 06:11:01 +0000 (06:11 +0000)
2007-12-06  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/34435
* module.c (find_symbol): Do not return symtrees with unique
names, which shows that they are private.

2007-12-06  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/34435
* gfortran.dg/used_types_19.f90: New test.

From-SVN: r130642

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

index 3b290ac590e24740d0bda5891c375e17ed332f9b..5d59c8920ac63d249ca081a88b89ced5691b449a 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-06  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/34435
+       * module.c (find_symbol): Do not return symtrees with unique
+       names, which shows that they are private.
+
 2007-12-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/33739
index af81c3aee7cfd7ad38366b33a4f727e5793f5341..c48bc68f9b2e4555ede9ab307d4f1fb87986ff3b 100644 (file)
@@ -3153,7 +3153,8 @@ find_symbol (gfc_symtree *st, const char *name,
 
   c = strcmp (name, st->n.sym->name);
   if (c == 0 && st->n.sym->module
-            && strcmp (module, st->n.sym->module) == 0)
+            && strcmp (module, st->n.sym->module) == 0
+            && !check_unique_name (st->name))
     {
       if ((!generic && !st->n.sym->attr.generic)
             || (generic && st->n.sym->attr.generic))
index f2fcadb58c2c9174324f3de6f9a5709b54ae792c..b19a44829158b934962da96afa45b8df48dd1caa 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-06  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/34435
+       * gfortran.dg/used_types_19.f90: New test.
+
 2007-12-06  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        * gfortran.dg/nan_2.f90: Add -mieee for sh.
diff --git a/gcc/testsuite/gfortran.dg/used_types_19.f90 b/gcc/testsuite/gfortran.dg/used_types_19.f90
new file mode 100644 (file)
index 0000000..dbec8dc
--- /dev/null
@@ -0,0 +1,26 @@
+! { dg-do compile }
+! Tests the fix for PR34335 a regression in which the PRIVATE attribute
+! of type(a) in module b would be ignored and would prevent it being
+! loaded in the main program.
+!
+! Contributed by Janus Weil <jaydub66@gmail.com>
+!
+module A
+  type A_type
+    real comp
+  end type
+end module A
+
+module B
+  use A
+  private
+  type(A_type) :: B_var
+  public:: B_var
+end module B
+
+program C
+  use B
+  use A
+  type(A_type):: A_var
+end program C
+! { dg-final { cleanup-modules "a b" } }