aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 9d144872..8fa305c 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -874,6 +874,10 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
/* 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))
{