From: Greg Kroah-Hartman Date: Fri, 24 Jul 2009 21:50:32 +0000 (-0700) Subject: Linux 2.6.27.28 and 2.6.30.3 X-Git-Tag: v2.6.30.3^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ddc7ca37972045b70494c85fc890e2a234c5a28a;p=thirdparty%2Fkernel%2Fstable-queue.git Linux 2.6.27.28 and 2.6.30.3 --- diff --git a/releases/2.6.27.28/fbmon-work-around-compiler-bug-in-gcc-4.2.4.patch b/releases/2.6.27.28/fbmon-work-around-compiler-bug-in-gcc-4.2.4.patch new file mode 100644 index 00000000000..ff634f34b28 --- /dev/null +++ b/releases/2.6.27.28/fbmon-work-around-compiler-bug-in-gcc-4.2.4.patch @@ -0,0 +1,49 @@ +From 3730793d457fed79a6d49bae72996d458c8e4f2d Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Wed, 22 Jul 2009 08:49:22 -0700 +Subject: fbmon: work around compiler bug in gcc-4.2.4 + +From: Linus Torvalds + +commit 3730793d457fed79a6d49bae72996d458c8e4f2d upstream. + +There's some odd bug in gcc-4.2 where it miscompiles a simple loop whent +he loop counter is of type 'unsigned char' and it should count to 128. + +The compiler will incorrectly decide that a trivial loop like this: + + unsigned char i, ... + + for (i = 0; i < 128; i++) { + .. + +is endless, and will compile it to a single instruction that just +branches to itself. + +This was triggered by the addition of '-fno-strict-overflow', and we +could play games with compiler versions and go back to '-fwrapv' +instead, but the trivial way to avoid it is to just make the loop +induction variable be an 'int' instead. + +Thanks to Krzysztof Oledzki for reporting and testing and to Troy Moure +for digging through assembler differences and finding it. + +Reported-and-tested-by: Krzysztof Oledzki +Found-by: Troy Moure +Gcc-bug-acked-by: Ian Lance Taylor +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- a/drivers/video/fbmon.c ++++ b/drivers/video/fbmon.c +@@ -256,8 +256,8 @@ static void fix_edid(unsigned char *edid, int fix) + + static int edid_checksum(unsigned char *edid) + { +- unsigned char i, csum = 0, all_null = 0; +- int err = 0, fix = check_edid(edid); ++ unsigned char csum = 0, all_null = 0; ++ int i, err = 0, fix = check_edid(edid); + + if (fix) + fix_edid(edid, fix); diff --git a/releases/2.6.30.3/fbmon-work-around-compiler-bug-in-gcc-4.2.4.patch b/releases/2.6.30.3/fbmon-work-around-compiler-bug-in-gcc-4.2.4.patch new file mode 100644 index 00000000000..ff634f34b28 --- /dev/null +++ b/releases/2.6.30.3/fbmon-work-around-compiler-bug-in-gcc-4.2.4.patch @@ -0,0 +1,49 @@ +From 3730793d457fed79a6d49bae72996d458c8e4f2d Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Wed, 22 Jul 2009 08:49:22 -0700 +Subject: fbmon: work around compiler bug in gcc-4.2.4 + +From: Linus Torvalds + +commit 3730793d457fed79a6d49bae72996d458c8e4f2d upstream. + +There's some odd bug in gcc-4.2 where it miscompiles a simple loop whent +he loop counter is of type 'unsigned char' and it should count to 128. + +The compiler will incorrectly decide that a trivial loop like this: + + unsigned char i, ... + + for (i = 0; i < 128; i++) { + .. + +is endless, and will compile it to a single instruction that just +branches to itself. + +This was triggered by the addition of '-fno-strict-overflow', and we +could play games with compiler versions and go back to '-fwrapv' +instead, but the trivial way to avoid it is to just make the loop +induction variable be an 'int' instead. + +Thanks to Krzysztof Oledzki for reporting and testing and to Troy Moure +for digging through assembler differences and finding it. + +Reported-and-tested-by: Krzysztof Oledzki +Found-by: Troy Moure +Gcc-bug-acked-by: Ian Lance Taylor +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- a/drivers/video/fbmon.c ++++ b/drivers/video/fbmon.c +@@ -256,8 +256,8 @@ static void fix_edid(unsigned char *edid, int fix) + + static int edid_checksum(unsigned char *edid) + { +- unsigned char i, csum = 0, all_null = 0; +- int err = 0, fix = check_edid(edid); ++ unsigned char csum = 0, all_null = 0; ++ int i, err = 0, fix = check_edid(edid); + + if (fix) + fix_edid(edid, fix);