summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.7
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-07-18 20:19:08 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-18 22:24:41 +0100
commit3e89b62a4783604550731b8846f8d9147a8f5d5c (patch)
treec0cafba3717317e44fb2d3c0afe5fd7669cafb42 /meta/recipes-devtools/gcc/gcc-4.7
parentac7a0311825e20c544d17bfd8be63546ad36e665 (diff)
downloadpoky-3e89b62a4783604550731b8846f8d9147a8f5d5c.tar.gz
gcc: remove 904-flatten-switch-stmt-00.patch
Remove brute-force flattening and bump PR. Refer to -ftree-switch-conversion emit_case_bit_tests(), -ftree-if-to-switch-conversion et al in 4.8 (From OE-Core rev: 2eb0e56217137ece3d86a70676a3f3c8db525459) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.7')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.7/904-flatten-switch-stmt-00.patch76
1 files changed, 0 insertions, 76 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.7/904-flatten-switch-stmt-00.patch b/meta/recipes-devtools/gcc/gcc-4.7/904-flatten-switch-stmt-00.patch
deleted file mode 100644
index e790e06dcb..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.7/904-flatten-switch-stmt-00.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1Upstream-Status: Pending
2
3Hi,
4
5The attached patch makes sure that we create smaller object code for
6simple switch statements. We just make sure to flatten the switch
7statement into an if-else chain, basically.
8
9This fixes a size-regression as compared to gcc-3.4, as can be seen
10below.
11
122007-04-15 Bernhard Fischer <..>
13
14 * stmt.c (expand_case): Do not create a complex binary tree when
15 optimizing for size but rather use the simple ordered list.
16 (emit_case_nodes): do not emit jumps to the default_label when
17 optimizing for size.
18
19Not regtested so far.
20Comments?
21
22Attached is the test switch.c mentioned below.
23
24$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
25gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
26$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
27gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
28
29$ size switch-*.o
30 text data bss dec hex filename
31 169 0 0 169 a9 switch-2.95.o
32 115 0 0 115 73 switch-3.3.o
33 103 0 0 103 67 switch-3.4.o
34 124 0 0 124 7c switch-4.0.o
35 124 0 0 124 7c switch-4.1.o
36 124 0 0 124 7c switch-4.2.orig-HEAD.o
37 95 0 0 95 5f switch-4.3-HEAD.o
38 124 0 0 124 7c switch-4.3.orig-HEAD.o
39 166 0 0 166 a6 switch-CHAIN-2.95.o
40 111 0 0 111 6f switch-CHAIN-3.3.o
41 95 0 0 95 5f switch-CHAIN-3.4.o
42 95 0 0 95 5f switch-CHAIN-4.0.o
43 95 0 0 95 5f switch-CHAIN-4.1.o
44 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
45 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
46 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
47
48
49Content-Type: text/x-diff; charset=us-ascii
50Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
51
52Index: gcc-4_7-branch/gcc/stmt.c
53===================================================================
54--- gcc-4_7-branch.orig/gcc/stmt.c 2012-04-10 10:19:49.095337065 -0700
55+++ gcc-4_7-branch/gcc/stmt.c 2012-04-10 10:32:52.219375048 -0700
56@@ -2397,7 +2397,11 @@
57 default code is emitted. */
58
59 use_cost_table = estimate_case_costs (case_list);
60- balance_case_nodes (&case_list, NULL);
61+ /* When optimizing for size, we want a straight list to avoid
62+ jumps as much as possible. This basically creates an if-else
63+ chain. */
64+ if (!optimize_size)
65+ balance_case_nodes (&case_list, NULL);
66 emit_case_nodes (index, case_list, default_label, index_type);
67 if (default_label)
68 emit_jump (default_label);
69@@ -2965,6 +2969,7 @@
70 {
71 if (!node_has_low_bound (node, index_type))
72 {
73+ if (!optimize_size) /* don't jl to the .default_label. */
74 emit_cmp_and_jump_insns (index,
75 convert_modes
76 (mode, imode,