1 # DP: 2004-09-26 Roger Sayle <roger@eyesopen.com>
4 # DP: Backport from mainline
5 # DP: 2004-05-20 Falk Hueffner <falk@debian.org>
6 # DP: * libgcc2.c (__mulvsi3): Fix overflow test.
8 diff -u -r1.170.6.1 -r1.170.6.2
9 --- gcc/gcc/libgcc2.c 2004/07/17 21:18:47 1.170.6.1
10 +++ gcc/gcc/libgcc2.c 2004/09/26 20:47:14 1.170.6.2
13 const DWtype w = (DWtype) a * (DWtype) b;
15 - if (((a >= 0) == (b >= 0))
16 - ? (UDWtype) w > (UDWtype) (((DWtype) 1 << (WORD_SIZE - 1)) - 1)
17 - : (UDWtype) w < (UDWtype) ((DWtype) -1 << (WORD_SIZE - 1)))
18 + if ((Wtype) (w >> WORD_SIZE) != (Wtype) w >> (WORD_SIZE - 1))
23 /cvs/gcc/gcc/gcc/testsuite/gcc.dg/ftrapv-1.c,v --> standard output
25 --- gcc/gcc/testsuite/gcc.dg/ftrapv-1.c
26 +++ /dev/null 2004-10-15 06:22:06.980596000 +0000
28 +/* Copyright (C) 2004 Free Software Foundation.
31 + Verify correct overflow checking with -ftrapv.
33 + Written by Falk Hueffner, 20th May 2004. */
36 +/* { dg-options "-ftrapv" } */
38 +__attribute__((noinline)) int