2018-03-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/84734
* arith.c (check_result, eval_intrinsic): If result overflows, pass
the expression up the chain instead of a NULL pointer.
2018-03-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/84734
* gfortran.dg/pr84734.f90: New test.
From-SVN: r258416
+2018-03-10 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/84734
+ * arith.c (check_result, eval_intrinsic): If result overflows, pass
+ the expression up the chain instead of a NULL pointer.
+
2018-03-07 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/64124
val = ARITH_OK;
}
- if (val != ARITH_OK)
- gfc_free_expr (r);
- else
+ if (val == ARITH_OK || val == ARITH_OVERFLOW)
*rp = r;
+ else
+ gfc_free_expr (r);
return val;
}
if (rc != ARITH_OK)
{
gfc_error (gfc_arith_error (rc), &op1->where);
+ if (rc == ARITH_OVERFLOW)
+ goto done;
return NULL;
}
+done:
+
gfc_free_expr (op1);
gfc_free_expr (op2);
return result;
+2018-03-10 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/84734
+ * gfortran.dg/pr84734.f90: New test.
+
2018-03-10 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/prot3.adb: New test.
--- /dev/null
+! { dg-do compile }
+! PR fortran/84734
+ integer :: b(huge(1_8)+1_8) = 0 ! { dg-error "Arithmetic overflow" }
+ end