bump version
[buildroot.git] / toolchain / gcc / 3.4.2 / 300-pr15526.patch
blobf01c59f1144fa147f94677be1d413a46bccfe287
1 # DP: 2004-09-26 Roger Sayle <roger@eyesopen.com>
2 # DP:
3 # DP: PR other/15526
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
11 @@ -130,9 +130,7 @@
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))
19 abort ();
21 return w;
23 /cvs/gcc/gcc/gcc/testsuite/gcc.dg/ftrapv-1.c,v --> standard output
24 revision 1.1.22.1
25 --- gcc/gcc/testsuite/gcc.dg/ftrapv-1.c
26 +++ /dev/null 2004-10-15 06:22:06.980596000 +0000
27 @@ -0,0 +1,25 @@
28 +/* Copyright (C) 2004 Free Software Foundation.
30 + PR other/15526
31 + Verify correct overflow checking with -ftrapv.
33 + Written by Falk Hueffner, 20th May 2004. */
35 +/* { dg-do run } */
36 +/* { dg-options "-ftrapv" } */
38 +__attribute__((noinline)) int
39 +mulv(int a, int b)
41 + return a * b;
44 +int
45 +main()
47 + mulv( 0, 0);
48 + mulv( 0, -1);
49 + mulv(-1, 0);
50 + mulv(-1, -1);
51 + return 0;