From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14489 invoked by alias); 13 Jul 2014 16:08:29 -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 14388 invoked by uid 48); 13 Jul 2014 16:08:25 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/61615] Failure to resolve correct generic with TYPE(C_PTR) arguments Date: Sun, 13 Jul 2014 16:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.10.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: WAITING 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: Message-ID: In-Reply-To: References: 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-07/txt/msg00815.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61615 --- Comment #6 from Dominique d'Humieres --- > Well, my understanding is that > > TYPE(c_ptr) :: a, b > > are pointers (void*) and > > TYPE(c_ptr) :: a(:), b(:) > > are arrays of pointers (void**). The result of -fdump-tree-original of PROGRAM cptr_array_vs_scalar_arg USE iso_c_binding IMPLICIT NONE INTEGER, TARGET :: i, j(5) TYPE(c_ptr) :: a, b a = C_LOC(i) b = C_LOC(j) END PROGRAM cptr_array_vs_scalar_arg is cptr_array_vs_scalar_arg () { void * a; void * b; integer(kind=4) i; integer(kind=4) j[5]; { void * D.2336; D.2336 = (void *) &i; a = D.2336; } { void * D.2337; D.2337 = (void *) &j; b = D.2337; } } main (integer(kind=4) argc, character(kind=1) * * argv) { static integer(kind=4) options.0[9] = {68, 1023, 0, 0, 1, 1, 0, 0, 31}; _gfortran_set_args (argc, argv); _gfortran_set_options (9, &options.0[0]); cptr_array_vs_scalar_arg (); return 0; }