The NCOPIES argument of REPEAT is not converted to the integer king the library
expects (kind=4), which can lead to segfaults. I changed that code recently, so
I'll fix it. I'll probably take this opportunity to have the front-end actually
emit an error if the NCOPIES argument is larger than a fixed value.

$ cat repeat.f90
   implicit none

   integer(kind=1) i
   real(kind=8) r
   character(len=2) s1, s2

   i = 1
   r = 1
   s1 = '42'
   r = nearest(r,r)
   s2 = repeat(s1,i)
end
$ gfortran repeat.f90 && ./a.out
Segmentation fault


-- 
           Summary: REPEAT argument NCOPIES is not converted as it should
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: fxcoudert at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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

Reply via email to