re PR fortran/67524 (ICE on using implicit character instead of implicit none etc.)
authorLouis Krupp <louis.krupp@zoho.com>
Wed, 5 Oct 2016 18:00:30 +0000 (18:00 +0000)
committerLouis Krupp <lkrupp@gcc.gnu.org>
Wed, 5 Oct 2016 18:00:30 +0000 (18:00 +0000)
2016-10-05  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/67524
* gfortran.dg/pr67524.f90: New test.

2016-10-05  Louis Krupp  <louis.krupp@zoho.com>

PR fortran/67524
* resolve.c (resolve_symbol): Don't apply default type rules to
mixed-entry master created for function entry points.

From-SVN: r240797

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

index e3097249af4d60807057d4f7de67f4ec623df415..e01c4bfb2ae3ac84a221c719b6b7eed2a52aab0c 100644 (file)
@@ -1,3 +1,9 @@
+2016-10-05  Louis Krupp  <louis.krupp@zoho.com>
+
+       PR fortran/67524
+       * resolve.c (resolve_symbol): Don't apply default type rules to
+       mixed-entry master created for function entry points.
+
 2016-09-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/66643
index 7b068f91f2c1f5b7f87c3a6f9db2f8ebd5d582f6..ddd9d742466ccc73bbfd95dd270d41c0859725fa 100644 (file)
@@ -13886,7 +13886,10 @@ resolve_symbol (gfc_symbol *sym)
          /* The specific case of an external procedure should emit an error
             in the case that there is no implicit type.  */
          if (!mp_flag)
-           gfc_set_default_type (sym, sym->attr.external, NULL);
+           {
+             if (!sym->attr.mixed_entry_master)
+               gfc_set_default_type (sym, sym->attr.external, NULL);
+           }
          else
            {
              /* Result may be in another namespace.  */
index 54d64ee984f42dabad551c04e07e2e76e162e7fa..653dee53d9345ea7424fc7f715dd95f819423c57 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-05  Louis Krupp  <louis.krupp@zoho.com>
+
+       PR fortran/67524
+       * gfortran.dg/pr67524.f90: New test.
+
 2016-10-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR sanitizer/77823
diff --git a/gcc/testsuite/gfortran.dg/pr67524.f90 b/gcc/testsuite/gfortran.dg/pr67524.f90
new file mode 100644 (file)
index 0000000..6f5440f
--- /dev/null
@@ -0,0 +1,20 @@
+! { dg-do run }
+module m
+   implicit character(8) (a-z)
+contains
+   function f(x)
+      integer :: x
+      integer :: f
+      real :: e
+      f = x
+      return
+   entry e(x)
+      e = x
+   end
+end module
+
+program p
+   use m
+   if (f(1) /= 1) call abort
+   if (e(1) /= 1.0) call abort
+end