Index: patches/gcc-4.1.0-fold_const_fix-1.patch
===================================================================
--- patches/gcc-4.1.0-fold_const_fix-1.patch	(revision 966f7254b75159a3aa4ae2c7356990042de48b93)
+++ patches/gcc-4.1.0-fold_const_fix-1.patch	(revision 966f7254b75159a3aa4ae2c7356990042de48b93)
@@ -0,0 +1,104 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2006-04-17
+Initial Package Version: 4.1.0
+Origin: Maintainers
+Upstream Status: Fixed in SVN
+Description: 
+Fixes an optimization error that can result incorrectly code. See PR's below
+
+Issues in CLFS book, this patch fixes the incorrect disk checksums in silo.
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27176
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763
+ 
+diff -Naur gcc-4.1.0.orig/ChangeLog gcc-4.1.0/ChangeLog
+--- gcc-4.1.0.orig/ChangeLog	2006-02-28 08:30:33.000000000 +0000
++++ gcc-4.1.0/ChangeLog	2006-04-17 19:32:36.000000000 +0000
+@@ -1,3 +1,12 @@
++2006-04-05  Richard Guenther  <rguenther@suse.de>
++
++	PR tree-optimization/26763
++	* fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
++	only for EQ_EXPR and NE_EXPR.
++
++	* gcc.dg/torture/pr26763-1.c: New testcase.
++	* gcc.dg/torture/pr26763-2.c: Likewise.
++
+ 2006-02-28  Release Manager
+ 
+ 	* GCC 4.1.0 released.
+diff -Naur gcc-4.1.0.orig/gcc/fold-const.c gcc-4.1.0/gcc/fold-const.c
+--- gcc-4.1.0.orig/gcc/fold-const.c	2006-02-03 18:02:04.000000000 +0000
++++ gcc-4.1.0/gcc/fold-const.c	2006-04-17 19:33:55.000000000 +0000
+@@ -8897,8 +8897,9 @@
+ 
+       /* If this is a comparison of two exprs that look like an
+ 	 ARRAY_REF of the same object, then we can fold this to a
+-	 comparison of the two offsets.  */
+-      if (TREE_CODE_CLASS (code) == tcc_comparison)
++	 comparison of the two offsets.  This is only safe for
++	 EQ_EXPR and NE_EXPR because of overflow issues.  */
++      if (code == EQ_EXPR || code == NE_EXPR)
+ 	{
+ 	  tree base0, offset0, base1, offset1;
+ 
+diff -Naur gcc-4.1.0.orig/gcc/testsuite/ChangeLog gcc-4.1.0/gcc/testsuite/ChangeLog
+--- gcc-4.1.0.orig/gcc/testsuite/ChangeLog	2006-02-28 08:27:59.000000000 +0000
++++ gcc-4.1.0/gcc/testsuite/ChangeLog	2006-04-17 19:35:18.000000000 +0000
+@@ -1,3 +1,12 @@
++2006-04-05  Richard Guenther  <rguenther@suse.de>
++
++	PR tree-optimization/26763
++	* fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
++	only for EQ_EXPR and NE_EXPR.
++
++	* gcc.dg/torture/pr26763-1.c: New testcase.
++	* gcc.dg/torture/pr26763-2.c: Likewise.
++
+ 2006-02-28  Release Manager
+ 
+ 	* GCC 4.1.0 released.
+diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-1.ch gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-1.ch
+--- gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-1.ch	1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-1.ch	2006-04-17 19:36:55.000000000 +0000
+@@ -0,0 +1,18 @@
++/* { dg-do run } */
++
++extern void abort(void);
++
++int try (int *a)
++{
++  return a + -1 > a;
++}
++
++int main(void)
++{
++  int bla[100];
++
++  if (try (bla + 50))
++    abort ();
++
++  return 0;
++}
+diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-2.c gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-2.c
+--- gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-2.c	1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-2.c	2006-04-17 19:37:11.000000000 +0000
+@@ -0,0 +1,18 @@
++/* { dg-do run } */
++
++extern void abort(void);
++
++int try (char *a, int d)
++{
++  return a + d > a;
++}
++
++int main(void)
++{
++  char bla[100];
++
++  if (try (bla + 50, -1))
++    abort ();
++
++  return 0;
++}
Index: tches/linux-2.6.16.5-sun_disklabel_fix-1.patch
===================================================================
--- patches/linux-2.6.16.5-sun_disklabel_fix-1.patch	(revision a7dcec276acf4a8414d68cb2d9cce1146a073681)
+++ 	(revision )
@@ -1,19 +1,0 @@
-Submitted By: Joe Ciccone <joeciccone at crazyeyesoft dot com>
-Date: 2006-04-14
-Initial Package Version: 2.6.16
-Upstream Status: Sent
-Origin: Joe Ciccone
-Description: This patch fixes fdisk so that it can properly calculate the
-             checksum of a sun disklabel
-
---- linux-2.6.16.orig/fs/partitions/sun.c	2006-04-14 18:12:32.000000000 -0400
-+++ linux-2.6.16/fs/partitions/sun.c	2006-04-14 18:13:14.000000000 -0400
-@@ -61,7 +61,7 @@
- 	}
- 	/* Look at the checksum */
- 	ush = ((__be16 *) (label+1)) - 1;
--	for (csum = 0; ush >= ((__be16 *) label);)
-+	while (ush < (__be16 *) label)
- 		csum ^= *ush--;
- 	if (csum) {
- 		printk("Dev %s Sun disklabel: Csum bad, label corrupted\n",
Index: tches/util-linux-2.12r-gcc41_sun_disklabel_fixes-1.patch
===================================================================
--- patches/util-linux-2.12r-gcc41_sun_disklabel_fixes-1.patch	(revision a7dcec276acf4a8414d68cb2d9cce1146a073681)
+++ 	(revision )
@@ -1,28 +1,0 @@
-Submitted By: Joe Ciccone <joeciccone at crazyeyesoft dot com>
-Date: 2006-04-14
-Initial Package Version: 2.12r
-Upstream Status: Sent
-Origin: Joe Ciccone
-Description: This patch fixes fdisk so that it can properly calculate the
-             checksum of a sun disklabel.
-
---- util-linux-2.12r.orig/fdisk/fdisksunlabel.c	2004-12-22 10:36:24.000000000 -0500
-+++ util-linux-2.12r/fdisk/fdisksunlabel.c	2006-04-14 17:50:53.000000000 -0400
-@@ -118,7 +118,7 @@
- int
- check_sun_label(void) {
- 	unsigned short *ush;
--	int csum;
-+	int csum = 0;
- 
- 	if (sunlabel->magic != SUN_LABEL_MAGIC &&
- 	    sunlabel->magic != SUN_LABEL_MAGIC_SWAPPED) {
-@@ -128,7 +128,7 @@
- 	}
- 	other_endian = (sunlabel->magic == SUN_LABEL_MAGIC_SWAPPED);
- 	ush = ((unsigned short *) (sunlabel + 1)) - 1;
--	for (csum = 0; ush >= (unsigned short *)sunlabel;) csum ^= *ush--;
-+	while (ush < (unsigned short *)sunlabel) csum ^= *ush--;
- 	if (csum) {
- 		fprintf(stderr,_("Detected sun disklabel with wrong checksum.\n"
- 				"Probably you'll have to set all the values,\n"
