summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/decl.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_16.f9021
4 files changed, 36 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9c950697dda..205fc19f0c6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-08 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/36459
+ * decl.c (match_procedure_decl): Correctly recognize if the interface
+ is an intrinsic procedure.
+
2008-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/35830
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ea87c211d49..c4ef7e7004d 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -4085,8 +4085,10 @@ match_procedure_decl (void)
return MATCH_ERROR;
}
/* Handle intrinsic procedures. */
- if (gfc_intrinsic_name (proc_if->name, 0)
- || gfc_intrinsic_name (proc_if->name, 1))
+ if (!(proc_if->attr.external || proc_if->attr.use_assoc
+ || proc_if->attr.if_source == IFSRC_IFBODY)
+ && (gfc_intrinsic_name (proc_if->name, 0)
+ || gfc_intrinsic_name (proc_if->name, 1)))
proc_if->attr.intrinsic = 1;
if (proc_if->attr.intrinsic
&& !gfc_intrinsic_actual_ok (proc_if->name, 0))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d6a0c031e39..84ee84ca0a9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-08 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/36459
+ * gfortran.dg/proc_decl_16.f90: New.
+
2008-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/35830
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_16.f90 b/gcc/testsuite/gfortran.dg/proc_decl_16.f90
new file mode 100644
index 00000000000..3251e52f512
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_decl_16.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! PR fortran/36459
+!
+abstract interface
+ function dim()
+ integer :: dim
+ end function dim
+end interface
+procedure(dim) :: f
+
+interface
+ integer function tan()
+ end function
+end interface
+procedure(tan) :: g
+
+print *, f()
+
+print *, tan()
+
+end