summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gcc/gcc-4.5/more-epilogues.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/more-epilogues.patch')
-rw-r--r--recipes-devtools/gcc/gcc-4.5/more-epilogues.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/more-epilogues.patch b/recipes-devtools/gcc/gcc-4.5/more-epilogues.patch
new file mode 100644
index 0000000000..64f1cf3751
--- /dev/null
+++ b/recipes-devtools/gcc/gcc-4.5/more-epilogues.patch
@@ -0,0 +1,83 @@
1Index: a/gcc/cfgcleanup.c
2===================================================================
3--- a/gcc/cfgcleanup.c (revision 315947)
4+++ b/gcc/cfgcleanup.c (working copy)
5@@ -1179,13 +1179,19 @@ flow_find_head_matching_sequence (basic_
6
7 while (true)
8 {
9-
10- /* Ignore notes. */
11+ /* Ignore notes, except NOTE_INSN_EPILOGUE_BEG. */
12 while (!NONDEBUG_INSN_P (i1) && i1 != BB_END (bb1))
13- i1 = NEXT_INSN (i1);
14-
15+ {
16+ if (NOTE_P (i1) && NOTE_KIND (i1) == NOTE_INSN_EPILOGUE_BEG)
17+ break;
18+ i1 = NEXT_INSN (i1);
19+ }
20 while (!NONDEBUG_INSN_P (i2) && i2 != BB_END (bb2))
21- i2 = NEXT_INSN (i2);
22+ {
23+ if (NOTE_P (i2) && NOTE_KIND (i2) == NOTE_INSN_EPILOGUE_BEG)
24+ break;
25+ i2 = NEXT_INSN (i2);
26+ }
27
28 if (NOTE_P (i1) || NOTE_P (i2)
29 || JUMP_P (i1) || JUMP_P (i2))
30Index: a/gcc/cfglayout.c
31===================================================================
32--- a/gcc/cfglayout.c (revision 315947)
33+++ b/gcc/cfglayout.c (working copy)
34@@ -1295,6 +1295,16 @@ cfg_layout_initialize (unsigned int flag
35 bb->flags |= BB_NON_LOCAL_GOTO_TARGET;
36 }
37
38+ FOR_EACH_BB (bb)
39+ {
40+ rtx insn;
41+ FOR_BB_INSNS (bb, insn)
42+ if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG)
43+ {
44+ bb->flags |= BB_EPILOGUE_BEGIN;
45+ break;
46+ }
47+ }
48 cleanup_cfg (CLEANUP_CFGLAYOUT | flags);
49 }
50
51Index: a/gcc/basic-block.h
52===================================================================
53--- a/gcc/basic-block.h (revision 315947)
54+++ b/gcc/basic-block.h (working copy)
55@@ -332,7 +332,11 @@ enum bb_flags
56
57 /* Set on blocks that cannot be threaded through.
58 Only used in cfgcleanup.c. */
59- BB_NONTHREADABLE_BLOCK = 1 << 11
60+ BB_NONTHREADABLE_BLOCK = 1 << 11,
61+
62+ /* Set on blocks that have a NOTE_INSN_EPILOGUE_BEGIN.
63+ Only used in cfglayout mode. */
64+ BB_EPILOGUE_BEGIN = 1 << 12
65 };
66
67 /* Dummy flag for convenience in the hot/cold partitioning code. */
68Index: a/gcc/cfgrtl.c
69===================================================================
70--- a/gcc/cfgrtl.c (revision 315947)
71+++ b/gcc/cfgrtl.c (working copy)
72@@ -2707,7 +2707,10 @@ cfg_layout_can_merge_blocks_p (basic_blo
73 not allow us to redirect an edge by replacing a table jump. */
74 && (!JUMP_P (BB_END (a))
75 || ((!optimize || reload_completed)
76- ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a)))));
77+ ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a))))
78+ /* Don't separate a NOTE_INSN_EPILOGUE_BEG from its returnjump. */
79+ && (!(b->flags & BB_EPILOGUE_BEGIN)
80+ || returnjump_p (BB_END (b))));
81 }
82
83 /* Merge block A and B. The blocks must be mergeable. */