2017-01-23 Thomas Koenig <tkoenig@netcologne.de>
* arith.c (arith_power): If simplifying integer power expression
to zero, warn if -Winteger-division is given.
2017-01-23 Thomas Koenig <tkoenig@netcologne.de>
* gfortran.dg/integer_exponentiation_7.f90: New test.
From-SVN: r244830
+2017-01-23 Thomas Koenig <tkoenig@netcologne.de>
+
+ * arith.c (arith_power): If simplifying integer power expression
+ to zero, warn if -Winteger-division is given.
+
2017-01-22 Jakub Jelinek <jakub@redhat.com>
PR fortran/79154
{
/* if op2 < 0, op1**op2 == 0 because abs(op1) > 1. */
mpz_set_si (result->value.integer, 0);
+ if (warn_integer_division)
+ gfc_warning_now (OPT_Winteger_division, "Negative "
+ "exponent of integer has zero "
+ "result at %L", &result->where);
}
else if (gfc_extract_int (op2, &power))
{
+2017-01-23 Thomas Koenig <tkoenig@netcologne.de>
+
+ * gfortran.dg/integer_exponentiation_7.f90: New test.
+
2017-01-23 Bernd Schmidt <bschmidt@redhat.com>
PR rtl-optimization/78634
--- /dev/null
+! { dg-do compile }
+! { dg-options "-Winteger-division" }
+program main
+ print *,10**(-3) ! { dg-warning "Negative exponent of integer has zero result" }
+end program main