[Bug fortran/54788] ICE on pointer-array element assignment
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Oct 3 07:33:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54788
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
CC| |burnus at gcc dot gnu.org
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-10-03 07:32:43 UTC ---
(In reply to comment #1)
> I think both programs are invalid and should be rejected.
I concur.
(In reply to comment #0)
> vec(1) => vec(0)
> 1
> Error: Expected bounds specification for 'vec' at (1)
R733 pointer-assignment-stmt
is data-pointer-object [ (bounds-spec-list) ] => data-target
or data-pointer-object (bounds-remapping-list ) => data-target
or proc-pointer-object => proc-target
with
bounds-spec is lower-bound-expr :
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.
Thus, if you want to do bounds remapping, you have to specify a range, e.g.
vec(1:1) => vec(0:0)
> integer, pointer :: a(:)
> integer :: b
> a(0:0) => b
That violates C717 as the LHS is rank 1 and the RHS is scalar. But it shouldn't
give an ICE.
More information about the Gcc-bugs
mailing list