source: patches/gcc-4.1.0-PR26763-1.patch @ 96fbea0

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 96fbea0 was 4fc5a87, checked in by Jim Gifford <clfs@…>, 18 years ago

Added GCC multilib patch. Rename fold_const patch to PR # to keep consistency

  • Property mode set to 100644
File size: 3.1 KB
RevLine 
[966f725]1Submitted By: Jim Gifford (patches at jg555 dot com)
2Date: 2006-04-17
3Initial Package Version: 4.1.0
4Origin: Maintainers
5Upstream Status: Fixed in SVN
6Description:
7Fixes an optimization error that can result incorrectly code. See PR's below
8
9Issues in CLFS book, this patch fixes the incorrect disk checksums in silo.
10
11http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27176
12http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763
13 
14diff -Naur gcc-4.1.0.orig/ChangeLog gcc-4.1.0/ChangeLog
15--- gcc-4.1.0.orig/ChangeLog    2006-02-28 08:30:33.000000000 +0000
16+++ gcc-4.1.0/ChangeLog 2006-04-17 19:32:36.000000000 +0000
17@@ -1,3 +1,12 @@
18+2006-04-05  Richard Guenther  <rguenther@suse.de>
19+
20+       PR tree-optimization/26763
21+       * fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
22+       only for EQ_EXPR and NE_EXPR.
23+
24+       * gcc.dg/torture/pr26763-1.c: New testcase.
25+       * gcc.dg/torture/pr26763-2.c: Likewise.
26+
27 2006-02-28  Release Manager
28 
29        * GCC 4.1.0 released.
30diff -Naur gcc-4.1.0.orig/gcc/fold-const.c gcc-4.1.0/gcc/fold-const.c
31--- gcc-4.1.0.orig/gcc/fold-const.c     2006-02-03 18:02:04.000000000 +0000
32+++ gcc-4.1.0/gcc/fold-const.c  2006-04-17 19:33:55.000000000 +0000
33@@ -8897,8 +8897,9 @@
34 
35       /* If this is a comparison of two exprs that look like an
36         ARRAY_REF of the same object, then we can fold this to a
37-        comparison of the two offsets.  */
38-      if (TREE_CODE_CLASS (code) == tcc_comparison)
39+        comparison of the two offsets.  This is only safe for
40+        EQ_EXPR and NE_EXPR because of overflow issues.  */
41+      if (code == EQ_EXPR || code == NE_EXPR)
42        {
43          tree base0, offset0, base1, offset1;
44 
45diff -Naur gcc-4.1.0.orig/gcc/testsuite/ChangeLog gcc-4.1.0/gcc/testsuite/ChangeLog
46--- gcc-4.1.0.orig/gcc/testsuite/ChangeLog      2006-02-28 08:27:59.000000000 +0000
47+++ gcc-4.1.0/gcc/testsuite/ChangeLog   2006-04-17 19:35:18.000000000 +0000
48@@ -1,3 +1,12 @@
49+2006-04-05  Richard Guenther  <rguenther@suse.de>
50+
51+       PR tree-optimization/26763
52+       * fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
53+       only for EQ_EXPR and NE_EXPR.
54+
55+       * gcc.dg/torture/pr26763-1.c: New testcase.
56+       * gcc.dg/torture/pr26763-2.c: Likewise.
57+
58 2006-02-28  Release Manager
59 
60        * GCC 4.1.0 released.
61diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-1.ch gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-1.ch
62--- gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-1.ch    1970-01-01 00:00:00.000000000 +0000
63+++ gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-1.ch 2006-04-17 19:36:55.000000000 +0000
64@@ -0,0 +1,18 @@
65+/* { dg-do run } */
66+
67+extern void abort(void);
68+
69+int try (int *a)
70+{
71+  return a + -1 > a;
72+}
73+
74+int main(void)
75+{
76+  int bla[100];
77+
78+  if (try (bla + 50))
79+    abort ();
80+
81+  return 0;
82+}
83diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-2.c gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-2.c
84--- gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-2.c     1970-01-01 00:00:00.000000000 +0000
85+++ gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-2.c  2006-04-17 19:37:11.000000000 +0000
86@@ -0,0 +1,18 @@
87+/* { dg-do run } */
88+
89+extern void abort(void);
90+
91+int try (char *a, int d)
92+{
93+  return a + d > a;
94+}
95+
96+int main(void)
97+{
98+  char bla[100];
99+
100+  if (try (bla + 50, -1))
101+    abort ();
102+
103+  return 0;
104+}
Note: See TracBrowser for help on using the repository browser.