https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85520

            Bug ID: 85520
           Summary: [6/7/8 Regression] Out of memory when declaring a
                    character with len << 0
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Valid code with evaluated len << 0 (effective char length is zero) :


$ cat z1.f90
program p
   character(-huge(1)) :: c = ' '
   print *, len(c), c
end


$ cat z2.f90
program p
   character(-huge(1)) :: c(2) = ' '
   print *, len(c), size(c), c
end


$ gfortran-5 z2.f90
$ a.out
           0           2
$
$ gfortran-8-20180422 -c z2.f90
f951: out of memory allocating 18446744065119617032 bytes after a total of
503808 bytes

Reply via email to