This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49624] New: ICE with pointer-bound remapping
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 4 Jul 2011 07:00:22 +0000
- Subject: [Bug fortran/49624] New: ICE with pointer-bound remapping
- Auto-submitted: auto-generated
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.