Catch division by zero errors in array sizes.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Mon, 30 Dec 2019 10:34:11 +0000 (10:34 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Mon, 30 Dec 2019 10:34:11 +0000 (10:34 +0000)
commit672511187345d30ccd725214ac4b34b181bd6569
tree4dd5ef16a039f4e241f8d2222b19e3661cd794a5
parentc3182576ea48f175283e291094298831dd7046e5
Catch division by zero errors in array sizes.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/92961
* gfortran.h (gfc_seen_div0): Add declaration.
* arith.h (gfc_seen_div0): Add definition.
(eval_intrinsic): For integer division by zero, set gfc_seen_div0.
* decl.c (variable_decl):  If resolution resp. simplification
fails for array spec and a division of zero error has been
seen, return MATCH_ERROR.

2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/92961
* gfortran.dg/arith_divide_2.f90: New test.

From-SVN: r279762
gcc/fortran/ChangeLog
gcc/fortran/arith.c
gcc/fortran/decl.c
gcc/fortran/gfortran.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/arith_divide_2.f90 [new file with mode: 0644]