This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/28788] [gfortran: 4.1, 4.2 regression] ICE on valid code



------- Comment #13 from aovb94 at dsl dot pipex dot com  2006-08-26 12:15 -------
I'm getting an ICE and segmentation fault in the following code. I think it may
be related to Paul Thomas's observation about pointers to components of derived
type arrays. However, it does compile under these circumstances:

* when foo and bar are not in the module
* when the module contains foo or bar but not both
* when the types a and b have no reference to each other
* when  ", only, a (or b)" is not used on the use statement

      MODULE type_mod
         TYPE a
           INTEGER  :: n(10)
         END TYPE a
!
         TYPE b
           TYPE (a), POINTER :: m(:) => NULL ()
         END TYPE b
      END MODULE type_mod


      MODULE seg_mod
      CONTAINS
      SUBROUTINE foo (x)
      USE type_mod, ONLY : a     ! fails
!      USE type_mod              ! works
      IMPLICIT NONE
      TYPE (a)  :: x
!
      RETURN
      END SUBROUTINE foo
!
      SUBROUTINE bar (x)
      USE type_mod, ONLY : b      ! fails
!      USE type_mod               ! works
      IMPLICIT NONE
      TYPE (b)  :: x
!
      RETURN
      END SUBROUTINE bar
      END MODULE seg_mod

gfc -c type_mod.f95 seg_mod.f95

seg_mod.f95:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

gfc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --enable-languages=c,fortran
             --prefix=/home/martin/GCC/usr/local --disable-nls
             --disable-multilib --enable-shared --enable-threads=posix
             --disable-checking --enable-long-long --enable-__cxa_atexit
             --enable-clocale=gnu --disable-libunwind-exception
Thread model: posix
gcc version 4.2.0 20060825 (experimental)


-- 


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


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