f951: internal compiler error: in replace_comp, at fortran/expr.c:4203

Janus Weil janus@gcc.gnu.org
Sun Jan 13 10:21:00 GMT 2013


Hi,

> somehow my little program seems to be really evil (probably I just coded
> something badly wrong ...)
>
> (What I am actually trying to do is: Define an abstract type, which has a
> type bound procedure getx returning a real array of a dimension given by the
> bound procedure getdims.)
>
> Now I get an ICE somewhere else:

as for your previous program, gfortran 4.8 trunk correctly claims:

        procedure :: getx => pdf_point_getx
                 1
Error: Result mismatch for the overriding procedure 'getx' at (1):
Shape mismatch in dimension 1 of function result


which is fixed by changing

        real x(2)

into

        real, dimension(getdims(this)) :: x

However, this does not fix the ICE.

This is now: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55960

If you find more problems, maybe you can try to file a PR yourself
(it's actually not that hard: just make sure to use product "gcc" and
component "fortran", and put in a reasonable summary and description,
with the type of information that was contained in your email).

Thanks,
Janus


2013/1/13 Tilo Schwarz <tilo@tilo-schwarz.de>:
> Hi,
>
> somehow my little program seems to be really evil (probably I just coded
> something badly wrong ...)
>
> (What I am actually trying to do is: Define an abstract type, which has a
> type bound procedure getx returning a real array of a dimension given by the
> bound procedure getdims.)
>
> Now I get an ICE somewhere else:
>
> % gfortran -v prg_abstract.f08
> Driving: gfortran -v prg_abstract.f08 -l gfortran -l m -shared-libgcc
> Using built-in specs.
> COLLECT_GCC=gfortran
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper
> Target: i486-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-4'
> --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
> --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
> --program-suffix=-4.7 --enable-shared --enable-linker-build-id
> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext
> --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
> --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
> --enable-gnu-unique-object --enable-plugin --enable-objc-gc
> --enable-targets=all --with-arch-32=i586 --with-tune=generic
> --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
> --target=i486-linux-gnu
> Thread model: posix
> gcc version 4.7.2 (Debian 4.7.2-4)
> COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=i586'
>  /usr/lib/gcc/i486-linux-gnu/4.7/f951 prg_abstract.f08 -quiet -dumpbase
> prg_abstract.f08 -mtune=generic -march=i586 -auxbase prg_abstract -version
> -fintrinsic-modules-path /usr/lib/gcc/i486-linux-gnu/4.7/finclude -o
> /tmp/ccpH60SQ.s
> GNU Fortran (Debian 4.7.2-4) version 4.7.2 (i486-linux-gnu)
>         compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version
> 3.1.0-p10, MPC version 0.9
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> GNU Fortran (Debian 4.7.2-4) version 4.7.2 (i486-linux-gnu)
>         compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version
> 3.1.0-p10, MPC version 0.9
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> f951: internal compiler error: in replace_comp, at fortran/expr.c:4203
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
>
> % cat prg_abstract.f08
> module pdfs
>     type, abstract :: pdf
>     contains
>         procedure(getdims), deferred :: getdims
>         procedure(getx), deferred :: getx
>     end type pdf
>
>     abstract interface
>     pure function getdims(this)
>         import pdf
>         class(pdf), intent(in) :: this
>         integer getdims
>     end function getdims
>
>     pure function getx(this)
>         import pdf
>         class(pdf), intent(in) :: this
>         real, dimension(getdims(this)) :: getx
>     end function getx
>     end interface
>
>     type point
>         real x, y
>     end type point
>
>     type, extends(pdf) :: pdf_point
>         type(point) p
>     contains
>         procedure :: getdims => pdf_point_getdims
>         procedure :: getx => pdf_point_getx
>     end type pdf_point
>
> contains
>
>     pure function pdf_point_getdims(this) result(dims)
>         class(pdf_point), intent(in) :: this
>         integer dims
>         dims = 2
>     end function pdf_point_getdims
>
>     pure function pdf_point_getx(this) result(x)
>         class(pdf_point), intent(in) :: this
>         real x(2)
>         x(1) = this%p%x
>         x(2) = this%p%y
>     end function pdf_point_getx
>
> end module pdfs
>
>
> program abstract
>     use pdfs
>     type(pdf_point) pp
>     namelist /nml_pp/ pp
>
>     print nml_pp
>     print *, pp%getx()
> contains
>
> end program abstract
>
>
> Regards,
>         Tilo



More information about the Fortran mailing list