public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/60477] New: unlimited type class(*) not working properly
@ 2014-03-09 21:18 ghasemi.arash at gmail dot com
  2014-03-09 21:29 ` [Bug fortran/60477] " kargl at gcc dot gnu.org
  2014-03-22 21:42 ` dominiq at lps dot ens.fr
  0 siblings, 2 replies; 3+ messages in thread
From: ghasemi.arash at gmail dot com @ 2014-03-09 21:18 UTC (permalink / raw)
  To: gcc-bugs

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 <http://bugs.opensuse.org/> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/60477] unlimited type class(*) not working properly
  2014-03-09 21:18 [Bug fortran/60477] New: unlimited type class(*) not working properly ghasemi.arash at gmail dot com
@ 2014-03-09 21:29 ` kargl at gcc dot gnu.org
  2014-03-22 21:42 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: kargl at gcc dot gnu.org @ 2014-03-09 21:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60477

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
(In reply to Arash Ghasemi from comment #0)
> Created attachment 32320 [details]
> source file
> 
> hey folks. I couldn't use an unlimited pointer  "class(*), pointer" inside a
> procedure.

Arash, 

Can update to a newer version?  Your code compiles and
executes with 4.8.3 (prerelease) and 4.9.0 (trunk).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/60477] unlimited type class(*) not working properly
  2014-03-09 21:18 [Bug fortran/60477] New: unlimited type class(*) not working properly ghasemi.arash at gmail dot com
  2014-03-09 21:29 ` [Bug fortran/60477] " kargl at gcc dot gnu.org
@ 2014-03-22 21:42 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-03-22 21:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60477

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Based on comments 1 and 2, closing as FIXED.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-22 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-09 21:18 [Bug fortran/60477] New: unlimited type class(*) not working properly ghasemi.arash at gmail dot com
2014-03-09 21:29 ` [Bug fortran/60477] " kargl at gcc dot gnu.org
2014-03-22 21:42 ` dominiq at lps dot ens.fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).