diff options
author | falk <falk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-19 23:43:20 +0000 |
---|---|---|
committer | falk <falk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-19 23:43:20 +0000 |
commit | 0cf3a1b4a5ebad749c1c8af0291a315fa26e6ae2 (patch) | |
tree | d28c06eae10c078a6f4d7fc45d0fc1a6a827772f /gcc/libgcc2.c | |
parent | 61e2434b18b7d19c1fafe3fe454205b4d9615d0d (diff) | |
download | gcc-0cf3a1b4a5ebad749c1c8af0291a315fa26e6ae2.tar.gz |
PR other/15526
* libgcc2.c (__mulvsi3): Fix overflow test.
* gcc.dg/ftrapv-1.c: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r-- | gcc/libgcc2.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 34171ad9002..8a953ea8b76 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -130,9 +130,7 @@ __mulvsi3 (Wtype a, Wtype b) { const DWtype w = (DWtype) a * (DWtype) b; - if (((a >= 0) == (b >= 0)) - ? (UDWtype) w > (UDWtype) (((DWtype) 1 << (WORD_SIZE - 1)) - 1) - : (UDWtype) w < (UDWtype) ((DWtype) -1 << (WORD_SIZE - 1))) + if ((Wtype) (w >> WORD_SIZE) != (Wtype) w >> (WORD_SIZE - 1)) abort (); return w; |