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

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Author: tkoenig
Date: Mon Dec 30 15:29:30 2019
New Revision: 279770

URL: https://gcc.gnu.org/viewcvs?rev=279770&root=gcc&view=rev
Log:
Catch division by zero errors in array sizes.

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

        Backport from trunk
        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  <tkoe...@gcc.gnu.org>

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


Added:
    branches/gcc-8-branch/gcc/testsuite/gfortran.dg/arith_divide_2.f90
Modified:
    branches/gcc-8-branch/gcc/fortran/ChangeLog
    branches/gcc-8-branch/gcc/fortran/arith.c
    branches/gcc-8-branch/gcc/fortran/decl.c
    branches/gcc-8-branch/gcc/fortran/gfortran.h
    branches/gcc-8-branch/gcc/testsuite/ChangeLog

Reply via email to