From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11423 invoked by alias); 9 Mar 2014 21:18: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 11405 invoked by uid 48); 9 Mar 2014 21:18:08 -0000 From: "ghasemi.arash at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/60477] New: unlimited type class(*) not working properly Date: Sun, 09 Mar 2014 21:18: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.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ghasemi.arash 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 attachments.created 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-03/txt/msg00719.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60477 Bug ID: 60477 Summary: unlimited type class(*) not working properly Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: ghasemi.arash at gmail dot com Created attachment 32320 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32320&action=edit source file hey folks. I couldn't use an unlimited pointer "class(*), pointer" inside a procedure. here I've got a simple module that has a base data type named "ex1" and a child type "ex2" that extends "ex1". ================================================================ module oop2 implicit none private type ex1 integer :: a end type ex1 type, extends(ex1) :: ex2 real*8 :: b end type ex2 public :: ex1, ex2, printit contains subroutine printit(ex) implicit none class(ex1), target, intent(in) :: ex ! local vars class(*), pointer :: pnt => null() pnt => ex ! buggy :( end subroutine printit end module oop2 ================================================================ The problem arises inside "printit" procedure. When I defined the unlimited pointer "class(*), pointer :: pnt" it cause no problem and code compiles fine with gfortran 4.8.1. However when I start pointing to the subroutine's dummy argument "ex" I get the following error: ================================================================ new_bug.f90:31:0: internal compiler error: Segmentation fault end module oop2 ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. ================================================================ This code compiles fine with ifort. Here is the main program that I used ================================================================ program test use oop2 implicit none type(ex1) :: b b%a = 2 call printit(b) ! done here end program test ================================================================ The intel compiler also works fine with polymorphic data when I use different type for variable "b" defined in the main program like "type(ex2) :: b". Thanks