1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/gcc/3.3.1/pr11864-1-test.patch Sat May 19 13:10:11 2007 +0000
1.3 @@ -0,0 +1,45 @@
1.4 +--- /dev/null Sat Dec 14 13:56:51 2002
1.5 ++++ gcc-3.3.1/gcc/testsuite/gcc.dg/pr11864-1.c Sun Sep 14 14:32:24 2003
1.6 +@@ -0,0 +1,42 @@
1.7 ++/* PR optimization/11864
1.8 ++ * Reporter: Kazumoto Kojima <kkojima@gcc.gnu.org>
1.9 ++ * Summary: [3.3/3.4 regression] miscompiles zero extension and test
1.10 ++ * Description:
1.11 ++ * gcc-3.3/3.4 -O2 for sh target may miscompile the combination of zero extension
1.12 ++ * and test if it's zero.
1.13 ++ *
1.14 ++ * Testcase tweaked by dank@kegel.com. Not marked as xfail because it's a regression.
1.15 ++ */
1.16 ++/* { dg-do run } */
1.17 ++/* { dg-options "-O2" } */
1.18 ++
1.19 ++extern void abort(void);
1.20 ++
1.21 ++int val = 0xff00;
1.22 ++
1.23 ++int f(void)
1.24 ++{
1.25 ++ return val;
1.26 ++}
1.27 ++
1.28 ++unsigned char a[1];
1.29 ++
1.30 ++void foo(void)
1.31 ++{
1.32 ++ a[0] = f() & 255;
1.33 ++
1.34 ++ if (!a[0])
1.35 ++ a[0] = f() & 255;
1.36 ++
1.37 ++ if (!a[0])
1.38 ++ a[0] = 1 + (f() & 127);
1.39 ++}
1.40 ++
1.41 ++int main(int argc, char **argv)
1.42 ++{
1.43 ++ foo();
1.44 ++ if (!a[0])
1.45 ++ abort();
1.46 ++
1.47 ++ return 0;
1.48 ++}