From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6499 invoked by alias); 9 May 2012 17:11:24 -0000 Received: (qmail 6480 invoked by uid 22791); 9 May 2012 17:11:21 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 May 2012 17:11:07 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/53298] New: ICE in gfc_conv_scalarized_array_ref for ARRAY + substring Date: Wed, 09 May 2012 17:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-05/txt/msg01044.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53298 Bug #: 53298 Summary: ICE in gfc_conv_scalarized_array_ref for ARRAY + substring Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org Blocks: 45424 The following program segfaults. The problem is the expression array(:)(1:) ^^^--<-- substring This combination is seemingly not handled by gfc_conv_expr_descriptor. At the end, one gets a segfault for: gfc_conv_scalarized_array_ref (se=0x7fffffffcfe0, ar=0x1700538) at fortran/trans-array.c:3016 3016 expr = ss->info->expr; which is called via gfc_conv_array_ref <<< gfc_conv_variable <<< gfc_conv_string_length <<< get_array_charlen <<< gfc_conv_expr_descriptor. character(len=5) :: str(3) call f(str(:)) contains subroutine f(x) character(len=*) :: x(:) logical :: llll print *, size(x(:)(1:)) end subroutine f end The program compiles flawlessly with NAG f95 and prints "3". It fails with GCC 4.1.2, 4.3.4, 4.8.0 and probably all other versions.