From: Janus Weil Date: Sun, 8 Jun 2008 11:55:41 +0000 (+0200) Subject: re PR fortran/36459 (Wrong interface use for PROCEDURE) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1db9545dd92301f1ed321287b2363cf7d375fa3;p=gcc.git re PR fortran/36459 (Wrong interface use for PROCEDURE) 2008-06-08 Janus Weil PR fortran/36459 * decl.c (match_procedure_decl): Correctly recognize if the interface is an intrinsic procedure. 2008-06-08 Janus Weil PR fortran/36459 * gfortran.dg/proc_decl_16.f90: New. From-SVN: r136555 --- 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 + + PR fortran/36459 + * decl.c (match_procedure_decl): Correctly recognize if the interface + is an intrinsic procedure. + 2008-06-08 Tobias Burnus 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 + + PR fortran/36459 + * gfortran.dg/proc_decl_16.f90: New. + 2008-06-08 Tobias Burnus 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