summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0260-PR-tree-optimization-48975.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0260-PR-tree-optimization-48975.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0260-PR-tree-optimization-48975.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0260-PR-tree-optimization-48975.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0260-PR-tree-optimization-48975.patch
new file mode 100644
index 0000000000..15f98a3823
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0260-PR-tree-optimization-48975.patch
@@ -0,0 +1,61 @@
1From 29bc62bdd8a23a670e844de980879c53a7ab493b Mon Sep 17 00:00:00 2001
2From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Thu, 12 May 2011 17:46:15 +0000
4Subject: [PATCH] PR tree-optimization/48975
5 * tree-if-conv.c (combine_blocks): Call free_bb_predicate
6 on all bbs here and free and clear ifc_bbs at the end.
7
8 * gcc.dg/pr48975.c: New test.
9
10
11git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173710 138bc75d-0d04-0410-961f-82ee72b054a4
12
13index 81b52db..12ceb8e 100644
14new file mode 100644
15index 0000000..58658d8
16--- /dev/null
17+++ b/gcc/testsuite/gcc.dg/pr48975.c
18@@ -0,0 +1,18 @@
19+/* PR tree-optimization/48975 */
20+/* { dg-do compile } */
21+/* { dg-options "-O3 -ffast-math -fno-tree-slp-vectorize" } */
22+
23+static int
24+foo (int x)
25+{
26+ return (x > 0) ? 0 : x + 1;
27+}
28+
29+void
30+bar (unsigned int x)
31+{
32+ int l = 1;
33+lab:
34+ while (x)
35+ x = foo (x);
36+}
37diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
38index d70e232..a77186a 100644
39--- a/gcc/tree-if-conv.c
40+++ b/gcc/tree-if-conv.c
41@@ -1604,6 +1604,7 @@ combine_blocks (struct loop *loop)
42 for (i = 0; i < orig_loop_num_nodes; i++)
43 {
44 bb = ifc_bbs[i];
45+ free_bb_predicate (bb);
46 if (bb_with_exit_edge_p (loop, bb))
47 {
48 exit_bb = bb;
49@@ -1679,6 +1680,9 @@ combine_blocks (struct loop *loop)
50 && exit_bb != loop->header
51 && can_merge_blocks_p (loop->header, exit_bb))
52 merge_blocks (loop->header, exit_bb);
53+
54+ free (ifc_bbs);
55+ ifc_bbs = NULL;
56 }
57
58 /* If-convert LOOP when it is legal. For the moment this pass has no
59--
601.7.0.4
61