diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-27 00:09:58 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-27 00:09:58 +0000 |
commit | 8e3a3570a1dfe6dd204d970b60c1ae10403d6cb9 (patch) | |
tree | e5bd7b43a66eecda25a59f50c1f652bf60d38d9d /gcc/f | |
parent | 2ee01a85b1a756f93a21c9976fddee03eb17f502 (diff) | |
download | gcc-8e3a3570a1dfe6dd204d970b60c1ae10403d6cb9.tar.gz |
PR fortran/9793
* target.h (ffetarget_divide_integer1): Perform division by -1
using negation to prevent possible overflow trap on the host.
* g77.f-torture/compile/20030326.f: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64909 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/f')
-rw-r--r-- | gcc/f/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/f/target.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 561e2a198a8..0f82f0eb96e 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 971f8667ad9..7c48b791d1f 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) \ |