summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch')
-rw-r--r--toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch230
1 files changed, 0 insertions, 230 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch
deleted file mode 100644
index e6b58ac872..0000000000
--- a/toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch
+++ /dev/null
@@ -1,230 +0,0 @@
12011-03-09 Bernd Schmidt <bernds@codesourcery.com>
2
3 Issue #10649
4 gcc/
5 * dwarf2out.c (dwarf2out_begin_epilogue): Accept simplejumps
6 as well as returnjumps.
7 * cfganal.c (set_edge_can_fallthru_flag): Revert previous change
8 that tried to keep epilogue blocks adjacent.
9
102011-02-03 Bernd Schmidt <bernds@codesourcery.com>
11
12 gcc/
13 * function.c (prepare_shrink_wrap): New function.
14 (thread_prologue_and_epilogue_insns): Call it.
15
16=== modified file 'gcc/cfganal.c'
17--- old/gcc/cfganal.c 2011-02-08 10:51:58 +0000
18+++ new/gcc/cfganal.c 2011-03-10 14:55:10 +0000
19@@ -271,37 +271,6 @@
20 EDGE_SUCC (bb, 0)->flags |= EDGE_CAN_FALLTHRU;
21 EDGE_SUCC (bb, 1)->flags |= EDGE_CAN_FALLTHRU;
22 }
23- /* dwarf2out expects that a NOTE_INSN_EPILOGUE_BEGIN is always paired
24- with a return or a sibcall. Ensure that this remains the case if
25- they are in different basic blocks. */
26- FOR_EACH_BB (bb)
27- {
28- edge e;
29- edge_iterator ei;
30- rtx insn, end;
31-
32- end = BB_END (bb);
33- FOR_BB_INSNS (bb, insn)
34- if (GET_CODE (insn) == NOTE
35- && NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG
36- && !(CALL_P (end) && SIBLING_CALL_P (end))
37- && !returnjump_p (end))
38- {
39- basic_block other_bb = NULL;
40- FOR_EACH_EDGE (e, ei, bb->succs)
41- {
42- if (e->flags & EDGE_FALLTHRU)
43- other_bb = e->dest;
44- else
45- e->flags &= ~EDGE_CAN_FALLTHRU;
46- }
47- FOR_EACH_EDGE (e, ei, other_bb->preds)
48- {
49- if (!(e->flags & EDGE_FALLTHRU))
50- e->flags &= ~EDGE_CAN_FALLTHRU;
51- }
52- }
53- }
54 }
55
56 /* Find unreachable blocks. An unreachable block will have 0 in
57
58=== modified file 'gcc/dwarf2out.c'
59--- old/gcc/dwarf2out.c 2011-02-08 10:51:58 +0000
60+++ new/gcc/dwarf2out.c 2011-03-10 14:55:10 +0000
61@@ -2782,10 +2782,10 @@
62 dwarf2out_frame_debug_expr (insn, label);
63 }
64
65-/* Determine if we need to save and restore CFI information around this
66- epilogue. If SIBCALL is true, then this is a sibcall epilogue. If
67- we do need to save/restore, then emit the save now, and insert a
68- NOTE_INSN_CFA_RESTORE_STATE at the appropriate place in the stream. */
69+/* Determine if we need to save and restore CFI information around
70+ this epilogue. If we do need to save/restore, then emit the save
71+ now, and insert a NOTE_INSN_CFA_RESTORE_STATE at the appropriate
72+ place in the stream. */
73
74 void
75 dwarf2out_begin_epilogue (rtx insn)
76@@ -2800,8 +2800,10 @@
77 if (!INSN_P (i))
78 continue;
79
80- /* Look for both regular and sibcalls to end the block. */
81- if (returnjump_p (i))
82+ /* Look for both regular and sibcalls to end the block. Various
83+ optimization passes may cause us to jump to a common epilogue
84+ tail, so we also accept simplejumps. */
85+ if (returnjump_p (i) || simplejump_p (i))
86 break;
87 if (CALL_P (i) && SIBLING_CALL_P (i))
88 break;
89
90=== modified file 'gcc/function.c'
91--- old/gcc/function.c 2011-02-08 10:51:58 +0000
92+++ new/gcc/function.c 2011-03-10 14:55:10 +0000
93@@ -5038,6 +5038,127 @@
94 return true;
95 return false;
96 }
97+
98+/* Look for sets of call-saved registers in the first block of the
99+ function, and move them down into successor blocks if the register
100+ is used only on one path. This exposes more opportunities for
101+ shrink-wrapping.
102+ These kinds of sets often occur when incoming argument registers are
103+ moved to call-saved registers because their values are live across
104+ one or more calls during the function. */
105+
106+static void
107+prepare_shrink_wrap (basic_block entry_block)
108+{
109+ rtx insn, curr;
110+ FOR_BB_INSNS_SAFE (entry_block, insn, curr)
111+ {
112+ basic_block next_bb;
113+ edge e, live_edge;
114+ edge_iterator ei;
115+ rtx set, scan;
116+ unsigned destreg, srcreg;
117+
118+ if (!NONDEBUG_INSN_P (insn))
119+ continue;
120+ set = single_set (insn);
121+ if (!set)
122+ continue;
123+
124+ if (!REG_P (SET_SRC (set)) || !REG_P (SET_DEST (set)))
125+ continue;
126+ srcreg = REGNO (SET_SRC (set));
127+ destreg = REGNO (SET_DEST (set));
128+ if (hard_regno_nregs[srcreg][GET_MODE (SET_SRC (set))] > 1
129+ || hard_regno_nregs[destreg][GET_MODE (SET_DEST (set))] > 1)
130+ continue;
131+
132+ next_bb = entry_block;
133+ scan = insn;
134+
135+ for (;;)
136+ {
137+ live_edge = NULL;
138+ FOR_EACH_EDGE (e, ei, next_bb->succs)
139+ {
140+ if (REGNO_REG_SET_P (df_get_live_in (e->dest), destreg))
141+ {
142+ if (live_edge)
143+ {
144+ live_edge = NULL;
145+ break;
146+ }
147+ live_edge = e;
148+ }
149+ }
150+ if (!live_edge)
151+ break;
152+ /* We can sometimes encounter dead code. Don't try to move it
153+ into the exit block. */
154+ if (live_edge->dest == EXIT_BLOCK_PTR)
155+ break;
156+ if (EDGE_COUNT (live_edge->dest->preds) > 1)
157+ break;
158+ while (scan != BB_END (next_bb))
159+ {
160+ scan = NEXT_INSN (scan);
161+ if (NONDEBUG_INSN_P (scan))
162+ {
163+ rtx link;
164+ HARD_REG_SET set_regs;
165+
166+ CLEAR_HARD_REG_SET (set_regs);
167+ note_stores (PATTERN (scan), record_hard_reg_sets,
168+ &set_regs);
169+ if (CALL_P (scan))
170+ IOR_HARD_REG_SET (set_regs, call_used_reg_set);
171+ for (link = REG_NOTES (scan); link; link = XEXP (link, 1))
172+ if (REG_NOTE_KIND (link) == REG_INC)
173+ record_hard_reg_sets (XEXP (link, 0), NULL, &set_regs);
174+
175+ if (TEST_HARD_REG_BIT (set_regs, srcreg)
176+ || reg_referenced_p (SET_DEST (set),
177+ PATTERN (scan)))
178+ {
179+ scan = NULL_RTX;
180+ break;
181+ }
182+ if (CALL_P (scan))
183+ {
184+ rtx link = CALL_INSN_FUNCTION_USAGE (scan);
185+ while (link)
186+ {
187+ rtx tmp = XEXP (link, 0);
188+ if (GET_CODE (tmp) == USE
189+ && reg_referenced_p (SET_DEST (set), tmp))
190+ break;
191+ link = XEXP (link, 1);
192+ }
193+ if (link)
194+ {
195+ scan = NULL_RTX;
196+ break;
197+ }
198+ }
199+ }
200+ }
201+ if (!scan)
202+ break;
203+ next_bb = live_edge->dest;
204+ }
205+
206+ if (next_bb != entry_block)
207+ {
208+ rtx after = BB_HEAD (next_bb);
209+ while (!NOTE_P (after)
210+ || NOTE_KIND (after) != NOTE_INSN_BASIC_BLOCK)
211+ after = NEXT_INSN (after);
212+ emit_insn_after (PATTERN (insn), after);
213+ delete_insn (insn);
214+ }
215+ }
216+}
217+
218 #endif
219
220 #ifdef HAVE_return
221@@ -5215,6 +5336,8 @@
222 bitmap_head bb_antic_flags;
223 bitmap_head bb_on_list;
224
225+ prepare_shrink_wrap (entry_edge->dest);
226+
227 bitmap_initialize (&bb_antic_flags, &bitmap_default_obstack);
228 bitmap_initialize (&bb_on_list, &bitmap_default_obstack);
229
230