public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51754] New: [OOP] ICE on valid with class arrays
@ 2012-01-04 17:28 abenson at caltech dot edu
  2012-01-21 19:22 ` [Bug fortran/51754] " burnus at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: abenson at caltech dot edu @ 2012-01-04 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51754
           Summary: [OOP] ICE on valid with class arrays
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: abenson@caltech.edu


This test case gives an ICE on valid related to class arrays:

module test
  private

  type :: componentB
  end type componentB

  type :: treeNode
     class(componentB), allocatable, dimension(:) :: componentB
  end type treeNode

contains

  function BGet(self)
    implicit none
    class(componentB), pointer :: BGet
    class(treeNode), intent(in) :: self
    select type (self)
    class is (treeNode)
       BGet => self%componentB(1)
    end select
    return
  end function BGet

end module test

$ gfortran -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-4.7/bin/gfortran
COLLECT_LTO_WRAPPER=/opt/gcc-4.7/libexec/gcc/x86_64-unknown-linux-
gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7/configure --prefix=/opt/gcc-4.7 --enable-
languages=c,c++,fortran --disable-multilib
Thread model: posix
gcc version 4.7.0 20120103 (experimental) (GCC)
$ gfortran -c test.F90 -o test.o
test.F90: In function ‘bget’:
test.F90:19:0: internal compiler error: in gfc_conv_descriptor_offset, at 
fortran/trans-array.c:210
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

If I remove the "allocatable" I instead get:

$ gfortran -c test.F90 -o test.o
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


If I remove the "dimension(:)" and change the pointer association to:

       BGet => self%componentB

then it compiles successfully.


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

end of thread, other threads:[~2012-02-06  4:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-04 17:28 [Bug fortran/51754] New: [OOP] ICE on valid with class arrays abenson at caltech dot edu
2012-01-21 19:22 ` [Bug fortran/51754] " burnus at gcc dot gnu.org
2012-01-21 20:19 ` burnus at gcc dot gnu.org
2012-01-27 23:06 ` dominiq at lps dot ens.fr
2012-01-28 10:06 ` burnus at gcc dot gnu.org
2012-01-28 12:04 ` dominiq at lps dot ens.fr
2012-01-28 12:39 ` dominiq at lps dot ens.fr
2012-01-28 14:20 ` burnus at gcc dot gnu.org
2012-01-29 15:55 ` mikael at gcc dot gnu.org
2012-01-29 16:15 ` mikael at gcc dot gnu.org
2012-01-29 19:42 ` burnus at gcc dot gnu.org
2012-02-02 23:12 ` mikael at gcc dot gnu.org
2012-02-05 10:37 ` burnus at gcc dot gnu.org
2012-02-06  4:14 ` abenson at caltech dot edu

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).