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



             Bug #: 56575

           Summary: An invalid OO code causes ICE

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: latlon90180+gcc_bugzi...@gmail.com





Dear all,



An invalid code shown below causes ICE on gfortran 4.8.0 and gfortran 4.6.3.

gfortran 4.5.3 produces proper error messages for the code.



Sincerely,

Amato



$ cat ice.F90

module lib_container

  implicit none



  type:: Object

  end type Object



  type:: Container

    class(Object):: v

  end type Container



contains



  subroutine proc(self)

    class(Container), intent(inout):: self

  end subroutine proc

end module lib_container



-------------4.8-------------



$ /usr/lib/gcc-snapshot/bin/gfortran ice.F90  -c

f951: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.



$ /usr/lib/gcc-snapshot/bin/gfortran --version

GNU Fortran (Ubuntu/Linaro 20120314-0ubuntu2) 4.8.0 20120314 (experimental)

[trunk revision 185382]

Copyright (C) 2012 Free Software Foundation, Inc.



GNU Fortran comes with NO WARRANTY, to the extent permitted by law.

You may redistribute copies of GNU Fortran

under the terms of the GNU General Public License.

For more information about these matters, see the file named COPYING



-------------4.6-------------



$ gfortran-4.6 ice.F90 -c

f951: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <file:///share/doc/gcc-4.6/README.Bugs> for instructions.



$ gfortran-4.6 --version

GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Copyright (C) 2011 Free Software Foundation, Inc.



GNU Fortran comes with NO WARRANTY, to the extent permitted by law.

You may redistribute copies of GNU Fortran

under the terms of the GNU General Public License.

For more information about these matters, see the file named COPYING



-------------4.5-------------



$ gfortran-4.5 ice.F90 -c

ice.F90:8.21:



    class(Object):: v

                     1

Error: Component 'v' with CLASS at (1) must be allocatable or pointer

ice.F90:8.21:



    class(Object):: v

                     1

Error: Component 'v' with CLASS at (1) must be allocatable or pointer



$ gfortran-4.5 --version

GNU Fortran (Ubuntu/Linaro 4.5.3-12ubuntu2) 4.5.3

Copyright (C) 2010 Free Software Foundation, Inc.



GNU Fortran comes with NO WARRANTY, to the extent permitted by law.

You may redistribute copies of GNU Fortran

under the terms of the GNU General Public License.

For more information about these matters, see the file named COPYING

Reply via email to