From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25810 invoked by alias); 21 Nov 2005 15:53:30 -0000 Received: (qmail 25782 invoked by uid 48); 21 Nov 2005 15:53:28 -0000 Date: Mon, 21 Nov 2005 15:53:00 -0000 Message-ID: <20051121155328.25781.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/15809] ICE Using Pointer Functions In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pault at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2005-11/txt/msg02987.txt.bz2 List-Id: ------- Comment #14 from pault at gcc dot gnu dot org 2005-11-21 15:53 ------- I have become more than a little bit concerned that this PR is a wild goose chase. Applying a similar patch to Erik's, I can persuade some bits of code to do something. Furthermore, they are even the same things that ifort9.0 does; right down to segfaulting in the same places... mostly! However, getting anything useful out of such subroutines, even with ifort, is defeating me. >>From 12.4.1.1.... "If the dummy argument is a pointer, the actual argument shall be a pointer and the types, type parameters and ranks shall agree." Does this not make an automatic, character-length, pointer dummy incorrect code? "At the invocation of the procedure, the dummy argument pointer receives the pointer association status of the actual argument. If the actual argument is currently associated, the the dummy argument becomes associated with the same target... " Thus encouraged, I wrote this: SUBROUTINE A(p,l) CHARACTER(8), DIMENSION(:), pointer :: p if (associated (p)) then print *, p else print *, "not associated" end if END SUBROUTINE A character(8), dimension (:), pointer :: ptr character(8), dimension (2), target :: tar tar = "def" ptr => tar call a (ptr) if (associated (ptr)) print *, "in MAIN, ptr = ", ptr end ifort decides that p is not associated, whilst gfortran finds p to be associated but fails to recognise that p is a character and produces a "bad real" message at the print statement. It seems to me that, in gfortran, the dummy needs to be declared in the procedure and its data pointer set to that of the actual argument. Whether an automatic character length should work or not seems to be moot to me. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15809