From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20240 invoked by alias); 29 Dec 2010 22:18:51 -0000 Received: (qmail 20231 invoked by uid 22791); 29 Dec 2010 22:18:50 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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, 29 Dec 2010 22:18:46 +0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/44735] ICE on FORALL with character array pointer X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: tkoenig at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Known to fail Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 29 Dec 2010 22:18:00 -0000 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-12/txt/msg02931.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44735 Thomas Koenig changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu.org, | |tkoenig at gcc dot gnu.org Known to fail| | --- Comment #3 from Thomas Koenig 2010-12-29 22:18:34 UTC --- Hi Paul, The problem may well be where Joe pointed it out. In if (expr1->ts.type == BT_CHARACTER && expr1->ts.u.cl->length) { if (!expr1->ts.u.cl->backend_decl) { gfc_se tse; gfc_init_se (&tse, NULL); gfc_conv_expr (&tse, expr1->ts.u.cl->length); expr1->ts.u.cl->backend_decl = tse.expr; } type = gfc_get_character_type_len (gfc_default_character_kind, expr1->ts.u.cl->backend_decl); } the fact that expr1 has a substring reference is not taken into account, so it might be necessary to calculate the length of the string from expr1->ref->u.ss.end - expr1->ref.u.ss.start + 1. You may have to take care not to calculate any functions twice, though. Hope this helps a little bit.