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

            Bug ID: 84672
           Summary: -fcheck=bounds gives runtime error on allocation on
                    assignment with implicit type conversion
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eh.toussaint at gmail dot com
  Target Milestone: ---

The following program gives a runtime error when compiled with -fcheck=bounds.

program foo
   implicit none

   real                 :: x(2)
   integer, allocatable :: iy(:)

   x = 1
   iy = x
   write(*, *) iy
end program

$ gfortran -fcheck=bounds foo.f90 -o foo.exe && ./foo.exe
At line 8 of file foo.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'iy'
(18711
90219/2)

Error termination. Backtrace:

Could not print backtrace: libbacktrace could not find executable to open
#0  0x6f8aecb4
#1  0x6f8a11ce
#2  0x6f88105c
#3  0x40160b
#4  0x4017b5
#5  0x401287

Reply via email to