The following program gives an ICE. One reason could be the global variables.
(cf. PR27997 comment 21).

implicit none
integer i
character(len=2) :: c(3)
c = 'a'
c = [ [ trim(c(1)), 'a' ]//'c', 'cd' ]
print *, c
end

Variants to check (or combinations of those):
- Compile with -fbounds-check
- Use  c = '' or  c = 'ab'
- Use typespec after PR27997 has been fixed, either on the inner or on the
outer loop. E.g.
  c = [ [ character(1):: trim(c(1)), 'a' ]//'c', 'cd' ]
etc.


-- 
           Summary: ICE on nested character constructors
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35846

Reply via email to