From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4205 invoked by alias); 4 Jul 2011 07:00:39 -0000 Received: (qmail 4196 invoked by uid 22791); 4 Jul 2011 07:00:39 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM 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; Mon, 04 Jul 2011 07:00:22 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49624] New: ICE with pointer-bound remapping 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-invalid-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 Date: Mon, 04 Jul 2011 07:00: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: 2011-07/txt/msg00164.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49624 Summary: ICE with pointer-bound remapping Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org Assume: integer, target :: A(100) integer,pointer :: P(:,:) p(10,1:) => A end Compiling the program with gfortran results in: test.f90:4:0: internal compiler error: in gfc_trans_pointer_assignment, at fortran/trans-expr.c:5081 While the following variant gives: p(1:10,1:) => A 1 Error: Either all or none of the upper bounds must be specified at (1) Also the valid "p(1:10,1:10) => A" works. I think the compiler is right about rejecting the code, one finds: R733 pointer-assignment-stmt is data-pointer-object [ (bounds-spec-list) ] => data-target or data-pointer-object (bounds-remapping-list ) => data-target [...] R735 bounds-spec is lower-bound-expr : R736 bounds-remapping is lower-bound-expr : upper-bound-expr C716 (R733) If bounds-spec-list is specified, the number of bounds-specs shall equal the rank of data-pointer-object. C717 (R733) If bounds-remapping-list is specified, the number of bounds-remappings shall equal the rank of data-pointer-object. C718 (R733) If bounds-remapping-list is not specified, the ranks of data-pointer-object and data-target shall be the same. Thus, for bounds remapping both lower and upper bounds are required.