Fix PR fortran/93500, ICE on invalid.
authorThomas König <tkoenig@gcc.gnu.org>
Sun, 19 Apr 2020 10:56:32 +0000 (12:56 +0200)
committerThomas König <tkoenig@gcc.gnu.org>
Sun, 19 Apr 2020 10:56:32 +0000 (12:56 +0200)
commit4dc6437183aec5439b88b076315ad8f31794d24b
tree3006375e9d6885f006e2ca79e97a82785525b43b
parente1113ffbd619d0568fb3b37e9660d9e0ae7862f5
Fix PR fortran/93500, ICE on invalid.

Returning &gfc_bad_expr when simplifying bounds after a divisin by zero
happened results in the division by zero error actually reaching the user.

2020-04-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/93500
* resolve.c (resolve_operator): If both operands are
NULL, return false.
* simplify.c (simplify_bound): If a division by zero
was seen during bound simplification, free the
corresponcing expression and return &gfc_bad_expr.

2020-04-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/93500
* arith_divide_3.f90: New test.
gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/fortran/simplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/arith_divide_3.f90 [new file with mode: 0644]