aboutsummaryrefslogtreecommitdiff
path: root/gcc/f
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/f')
-rw-r--r--gcc/f/ChangeLog6
-rw-r--r--gcc/f/target.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 561e2a1..0f82f0e 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-26 Roger Sayle <roger@eyesopen.com>
+
+ PR fortran/9793
+ * target.h (ffetarget_divide_integer1): Perform division by -1
+ using negation to prevent possible overflow trap on the host.
+
2003-03-25 Marcelo Abreu <mmabreu@inf.ufrgs.br>
PR fortran/10204
diff --git a/gcc/f/target.h b/gcc/f/target.h
index 971f866..7c48b79 100644
--- a/gcc/f/target.h
+++ b/gcc/f/target.h
@@ -1154,7 +1154,8 @@ void *ffetarget_memcpy_ (void *dst, void *src, size_t len);
FFEBAD; })
#define ffetarget_divide_integer1(res,l,r) \
(((r) == 0) ? (*(res) = 0, FFEBAD_DIV_BY_ZERO) \
- : (*(res) = (l) / (r), FFEBAD))
+ : (((r) == -1) ? (*(res) = -(l), FFEBAD) \
+ : (*(res) = (l) / (r), FFEBAD)))
#define ffetarget_divide_integer2(res,l,r) \
ffetarget_divide_integer1(res,l,r)
#define ffetarget_divide_integer3(res,l,r) \