This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/69962] New: ICE on missing parameter attribute, in gfc_set_constant_character_len
- From: "gerhard dot steinmetz dot fortran at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Feb 2016 19:11:12 +0000
- Subject: [Bug fortran/69962] New: ICE on missing parameter attribute, in gfc_set_constant_character_len
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69962
Bug ID: 69962
Summary: ICE on missing parameter attribute, in
gfc_set_constant_character_len
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fortran@t-online.de
Target Milestone: ---
The following snippet is wrong because n is not declared as parameter :
$ cat z1.f90
program p
integer :: n = 1
character(3), parameter :: x(2) = ['abc', 'xyz']
character(2), parameter :: y(2) = [x(2)(2:3), x(n)(1:2)]
end
$ gfortran-6 z1.f90
f951: internal compiler error: in gfc_set_constant_character_len, at
fortran/decl.c:1304
---
Correct with parameter attribute :
$ cat z2.f90
program p
integer, parameter :: n = 1
character(3), parameter :: x(2) = ['abc', 'xyz']
character(2), parameter :: y(2) = [x(2)(2:3), x(n)(1:2)]
print *, x
print *, y
end
$ gfortran-6 z2.f90
$ a.out
abcxyz
yzab
---
Thematically related to pr66107.