From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3805 invoked by alias); 25 Jun 2014 22:48:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3715 invoked by uid 48); 25 Jun 2014 22:48:03 -0000 From: "thatcadguy at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/61615] New: Failure to resolve correct generic with TYPE(C_PTR) arguments Date: Wed, 25 Jun 2014 22:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: thatcadguy at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-06/txt/msg02044.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61615 Bug ID: 61615 Summary: Failure to resolve correct generic with TYPE(C_PTR) arguments Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: thatcadguy at gmail dot com The following program does not produce the expected output (the line 'CALL bar(a, b)' does not choose the subroutine bar_s as it should, it chooses bar_a1d): MODULE foo USE iso_c_binding IMPLICIT NONE INTERFACE bar MODULE PROCEDURE bar_s MODULE PROCEDURE bar_a1d END INTERFACE bar CONTAINS SUBROUTINE bar_s(a, b) TYPE(c_ptr) :: a, b WRITE (0, *) 'in bar_s' END SUBROUTINE bar_s SUBROUTINE bar_a1d(a, b) TYPE(c_ptr) :: a(:), b(:) WRITE (0, *) 'in bar_a1d' END SUBROUTINE bar_a1d END MODULE foo PROGRAM cptr_array_vs_scalar_arg USE foo USE iso_c_binding IMPLICIT NONE INTEGER, TARGET :: i TYPE(c_ptr) :: a, b a = C_LOC(i) b = C_LOC(i) CALL bar(a, b) END PROGRAM cptr_array_vs_scalar_arg