From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20290 invoked by alias); 16 Jul 2010 08:50:59 -0000 Received: (qmail 20227 invoked by uid 48); 16 Jul 2010 08:50:44 -0000 Date: Fri, 16 Jul 2010 08:50:00 -0000 Subject: [Bug fortran/44962] New: [OOP] ICE with specification expression SIZE() X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg01683.txt.bz2 Reported by bd satish at http://gcc.gnu.org/ml/fortran/2010-07/msg00206.html The following program segfaults. The crucial part is that the argument has is CLASS and not TYPE - and that it is used in a specification expression. The ICE occurs when it is written to the .MOD file. Valgrind shows: ==15819== Invalid read of size 8 ==15819== at 0x50E636: mio_expr (module.c:3091) ==15819== by 0x50F0C9: mio_array_spec (module.c:2179) ==15819== by 0x50F208: mio_component (module.c:2371) ==15819== by 0x50F3E7: mio_symbol (module.c:2420) ==15819== by 0x50F82A: write_symbol (module.c:4804) ==15819== by 0x510CE5: write_symbol0 (module.c:4844) ==15819== by 0x51132B: gfc_dump_module (module.c:5022) ==15819== by 0x51BFE0: gfc_parse_file (parse.c:4388) module array type :: t_array real, dimension(10) :: coeff contains procedure, nopass :: get_coeff end type t_array contains function get_coeff(self) result(coeff) class(t_array), intent(in) :: self real, dimension(5) :: coeff i = size(self%coeff) end function get_coeff end module array -- Summary: [OOP] ICE with specification expression SIZE() Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44962