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

            Bug ID: 87969
           Summary: -fcheck does not raise signal
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: maik.riechert at arcor dot de
  Target Milestone: ---

When compiling code with -fcheck=.. I expect that a failing runtime check would
raise a signal so that gdb stops at that point, however this is not the case
and the program just exits after printing the runtime check message.

Example program:

program main
    implicit none
    real, dimension(5) :: arr
    arr(10) = 42.
end program

Compiled with "gfortran -g -fcheck=bounds main.F90" and run under gdb:

(gdb) run
Starting program: /.../a.out
At line 4 of file main.F90
Fortran runtime error: Index '10' of dimension 1 of array 'arr' above upper
bound of 5

Error termination. Backtrace:
#0  0x7ffffef9d37a in ???
#1  0x7ffffef9df15 in ???
#2  0x7ffffef9e2e7 in ???
#3  0x800073e in MAIN__
        at /.../main.F90:4
#4  0x8000774 in main
        at /.../main.F90:5
[Inferior 1 (process 29666) exited with code 02]

Reply via email to