This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ICE on pointer assignment error


I'm getting an ICE when gfortran reports an error in my code due to an 
incorrect pointer assignment. My original test case is in test1.F90:

$ gfortran -c test1.F90 -o test.o
test1.F90:30.7:

       workNode => thisNode
       1
Error: Different types in pointer assignment at (1); attempted assignment of 
CLASS(treenode) to TYPE(treenode)
f951: internal compiler error: in gfc_enforce_clean_symbol_state, at 
fortran/symbol.c:3426
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

(uncommenting the "select type" etc. lines in test1.F90 results in valid code 
which then compiles correctly).

I ran this test case through delta to reduce it further - the result was 
something slightly different, but likely related:

$ gfortran -c test2.F90 -o test.o
test2.F90:9.7:

       workNode => thisNode
       1
Error: Non-POINTER in pointer association context (pointer assignment) at (1)
f951: internal compiler error: in gfc_enforce_clean_symbol_state, at 
fortran/symbol.c:3426
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

These ICEs occur with gfortran 4.6 r170108

-Andrew.

-- 

* Andrew Benson: http://www.tapir.caltech.edu/~abenson/contact.html

* Galacticus: http://sites.google.com/site/galacticusmodel
module mod1
  type treeNode
  end type treeNode
contains
  subroutine proc1(thisNode)
    class (treeNode), target, intent(in) :: thisNode
    select type (thisNode)
    type is (treeNode)
       workNode => thisNode
    end select
  end subroutine proc1
end module mod1
module mod1
  private

  type treeNode
     integer :: id
  end type treeNode

contains

  subroutine proc1(thisNode)
    implicit none
    class (treeNode), target,  intent(inout) :: thisNode
    type (treeNode),  pointer                :: workNode

    select type (thisNode)
    type is (treeNode)
       workNode => thisNode
    end select

    return
  end subroutine proc1
  
  subroutine proc2(thisNode)
    implicit none
    class (treeNode), target,  intent(inout) :: thisNode
    type (treeNode),  pointer                :: workNode

!    select type (thisNode)
!    type is (treeNode)
       workNode => thisNode
!    end select

    return
  end subroutine proc2

end module mod1

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]