summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2020-05-11 21:27:11 +0200
committerHarald Anlauf <anlauf@gmx.de>2020-05-11 21:27:11 +0200
commit1422c2e4462c9b7c44aa035ac56af77565556181 (patch)
tree82151c03fa3cbf1471eb1e30ad5b6575cc2011b5 /gcc/fortran
parentaa2c978400f3b3ca6e9f2d18598a379589e77ba0 (diff)
PR fortran/95053 - ICE in gfc_divide(): Bad basic type
The fix for PR 93499 introduced a too strict check in gfc_divide that could trigger errors in the early parsing phase. Relax the check and defer to a later stage. gcc/fortran/ 2020-05-11 Harald Anlauf <anlauf@gmx.de> PR fortran/95053 * arith.c (gfc_divide): Do not error out if operand 2 is non-numeric. Defer checks to later stage. gcc/testsuite/ 2020-05-11 Harald Anlauf <anlauf@gmx.de> PR fortran/95053 * gfortran.dg/pr95053.f: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/arith.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a1a625abc1d..9f7b60e2ef9 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-11 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95053
+ * arith.c (gfc_divide): Do not error out if operand 2 is
+ non-numeric. Defer checks to later stage.
+
2020-05-11 Tobias Burnus <tobias@codesourcery.com>
PR fortran/94672
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 1cd0867a941..dd72f44d377 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1828,7 +1828,8 @@ gfc_divide (gfc_expr *op1, gfc_expr *op2)
rc = ARITH_DIV0;
break;
default:
- gfc_internal_error ("gfc_divide(): Bad basic type");
+ /* basic type is non-numeric, handle this elsewhere. */
+ break;
}
if (rc == ARITH_DIV0)
{