diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0365-gcc.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0365-gcc.patch | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0365-gcc.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0365-gcc.patch new file mode 100644 index 0000000000..3780763928 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0365-gcc.patch | |||
@@ -0,0 +1,125 @@ | |||
1 | From 158892fce220b03d3fe3d8d7656e1b0786609283 Mon Sep 17 00:00:00 2001 | ||
2 | From: rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Sun, 29 May 2011 17:47:51 +0000 | ||
4 | Subject: [PATCH] gcc/ | ||
5 | PR target/43995 | ||
6 | * config/mips/mips.c (mips_pic_call_symbol_from_set): Add a | ||
7 | recurse_p argument. Only follow register copies if it is set, | ||
8 | and prevent mips_find_pic_call_symbol from recursing. | ||
9 | (mips_find_pic_call_symbol): Add a recurse_p argument. | ||
10 | Pass it to mips_pic_call_symbol_from_set. | ||
11 | (mips_annotate_pic_calls): Update accordingly. | ||
12 | |||
13 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174404 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
14 | |||
15 | index 9de479b..027fc2d 100644 | ||
16 | --- a/gcc/config/mips/mips.c | ||
17 | +++ b/gcc/config/mips/mips.c | ||
18 | @@ -1186,7 +1186,7 @@ static const struct mips_rtx_cost_data | ||
19 | } | ||
20 | }; | ||
21 | |||
22 | -static rtx mips_find_pic_call_symbol (rtx, rtx); | ||
23 | +static rtx mips_find_pic_call_symbol (rtx, rtx, bool); | ||
24 | static int mips_register_move_cost (enum machine_mode, reg_class_t, | ||
25 | reg_class_t); | ||
26 | static unsigned int mips_function_arg_boundary (enum machine_mode, const_tree); | ||
27 | @@ -14160,12 +14160,16 @@ mips_call_expr_from_insn (rtx insn, rtx *second_call) | ||
28 | } | ||
29 | |||
30 | /* REG is set in DEF. See if the definition is one of the ways we load a | ||
31 | - register with a symbol address for a mips_use_pic_fn_addr_reg_p call. If | ||
32 | - it is return the symbol reference of the function, otherwise return | ||
33 | - NULL_RTX. */ | ||
34 | + register with a symbol address for a mips_use_pic_fn_addr_reg_p call. | ||
35 | + If it is, return the symbol reference of the function, otherwise return | ||
36 | + NULL_RTX. | ||
37 | + | ||
38 | + If RECURSE_P is true, use mips_find_pic_call_symbol to interpret | ||
39 | + the values of source registers, otherwise treat such registers as | ||
40 | + having an unknown value. */ | ||
41 | |||
42 | static rtx | ||
43 | -mips_pic_call_symbol_from_set (df_ref def, rtx reg) | ||
44 | +mips_pic_call_symbol_from_set (df_ref def, rtx reg, bool recurse_p) | ||
45 | { | ||
46 | rtx def_insn, set; | ||
47 | |||
48 | @@ -14192,21 +14196,39 @@ mips_pic_call_symbol_from_set (df_ref def, rtx reg) | ||
49 | return symbol; | ||
50 | } | ||
51 | |||
52 | - /* Follow simple register copies. */ | ||
53 | - if (REG_P (src)) | ||
54 | - return mips_find_pic_call_symbol (def_insn, src); | ||
55 | + /* Follow at most one simple register copy. Such copies are | ||
56 | + interesting in cases like: | ||
57 | + | ||
58 | + for (...) | ||
59 | + { | ||
60 | + locally_binding_fn (...); | ||
61 | + } | ||
62 | + | ||
63 | + and: | ||
64 | + | ||
65 | + locally_binding_fn (...); | ||
66 | + ... | ||
67 | + locally_binding_fn (...); | ||
68 | + | ||
69 | + where the load of locally_binding_fn can legitimately be | ||
70 | + hoisted or shared. However, we do not expect to see complex | ||
71 | + chains of copies, so a full worklist solution to the problem | ||
72 | + would probably be overkill. */ | ||
73 | + if (recurse_p && REG_P (src)) | ||
74 | + return mips_find_pic_call_symbol (def_insn, src, false); | ||
75 | } | ||
76 | |||
77 | return NULL_RTX; | ||
78 | } | ||
79 | |||
80 | -/* Find the definition of the use of REG in INSN. See if the definition is | ||
81 | - one of the ways we load a register with a symbol address for a | ||
82 | - mips_use_pic_fn_addr_reg_p call. If it is return the symbol reference of | ||
83 | - the function, otherwise return NULL_RTX. */ | ||
84 | +/* Find the definition of the use of REG in INSN. See if the definition | ||
85 | + is one of the ways we load a register with a symbol address for a | ||
86 | + mips_use_pic_fn_addr_reg_p call. If it is return the symbol reference | ||
87 | + of the function, otherwise return NULL_RTX. RECURSE_P is as for | ||
88 | + mips_pic_call_symbol_from_set. */ | ||
89 | |||
90 | static rtx | ||
91 | -mips_find_pic_call_symbol (rtx insn, rtx reg) | ||
92 | +mips_find_pic_call_symbol (rtx insn, rtx reg, bool recurse_p) | ||
93 | { | ||
94 | df_ref use; | ||
95 | struct df_link *defs; | ||
96 | @@ -14218,7 +14240,7 @@ mips_find_pic_call_symbol (rtx insn, rtx reg) | ||
97 | defs = DF_REF_CHAIN (use); | ||
98 | if (!defs) | ||
99 | return NULL_RTX; | ||
100 | - symbol = mips_pic_call_symbol_from_set (defs->ref, reg); | ||
101 | + symbol = mips_pic_call_symbol_from_set (defs->ref, reg, recurse_p); | ||
102 | if (!symbol) | ||
103 | return NULL_RTX; | ||
104 | |||
105 | @@ -14227,7 +14249,7 @@ mips_find_pic_call_symbol (rtx insn, rtx reg) | ||
106 | { | ||
107 | rtx other; | ||
108 | |||
109 | - other = mips_pic_call_symbol_from_set (defs->ref, reg); | ||
110 | + other = mips_pic_call_symbol_from_set (defs->ref, reg, recurse_p); | ||
111 | if (!rtx_equal_p (symbol, other)) | ||
112 | return NULL_RTX; | ||
113 | } | ||
114 | @@ -14298,7 +14320,7 @@ mips_annotate_pic_calls (void) | ||
115 | if (!REG_P (reg)) | ||
116 | continue; | ||
117 | |||
118 | - symbol = mips_find_pic_call_symbol (insn, reg); | ||
119 | + symbol = mips_find_pic_call_symbol (insn, reg, true); | ||
120 | if (symbol) | ||
121 | { | ||
122 | mips_annotate_pic_call_expr (call, symbol); | ||
123 | -- | ||
124 | 1.7.0.4 | ||
125 | |||