|
Line
Link Here
|
| 0 |
-- a/gcc/ipa-cp.c |
0 |
++ b/gcc/ipa-cp.c |
|
Lines 820-826
build_toporder_info (struct ipa_topo_info *topo)
Link Here
|
| 820 |
topo->stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count); |
820 |
topo->stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count); |
| 821 |
|
821 |
|
| 822 |
gcc_checking_assert (topo->stack_top == 0); |
822 |
gcc_checking_assert (topo->stack_top == 0); |
| 823 |
topo->nnodes = ipa_reduced_postorder (topo->order, true, true, NULL); |
823 |
topo->nnodes = ipa_reduced_postorder (topo->order, true, NULL); |
| 824 |
} |
824 |
} |
| 825 |
|
825 |
|
| 826 |
/* Free information about strongly connected components and the arrays in |
826 |
/* Free information about strongly connected components and the arrays in |
| 827 |
-- a/gcc/ipa-inline.c |
827 |
++ b/gcc/ipa-inline.c |
|
Lines 1759-1765
inline_small_functions (void)
Link Here
|
| 1759 |
metrics. */ |
1759 |
metrics. */ |
| 1760 |
|
1760 |
|
| 1761 |
max_count = profile_count::uninitialized (); |
1761 |
max_count = profile_count::uninitialized (); |
| 1762 |
ipa_reduced_postorder (order, true, true, NULL); |
1762 |
ipa_reduced_postorder (order, true, NULL); |
| 1763 |
free (order); |
1763 |
free (order); |
| 1764 |
|
1764 |
|
| 1765 |
FOR_EACH_DEFINED_FUNCTION (node) |
1765 |
FOR_EACH_DEFINED_FUNCTION (node) |
| 1766 |
-- a/gcc/ipa-pure-const.c |
1766 |
++ b/gcc/ipa-pure-const.c |
|
Lines 1443-1449
propagate_pure_const (void)
Link Here
|
| 1443 |
bool remove_p = false; |
1443 |
bool remove_p = false; |
| 1444 |
bool has_cdtor; |
1444 |
bool has_cdtor; |
| 1445 |
|
1445 |
|
| 1446 |
order_pos = ipa_reduced_postorder (order, true, false, |
1446 |
order_pos = ipa_reduced_postorder (order, true, |
| 1447 |
ignore_edge_for_pure_const); |
1447 |
ignore_edge_for_pure_const); |
| 1448 |
if (dump_file) |
1448 |
if (dump_file) |
| 1449 |
{ |
1449 |
{ |
|
Lines 1773-1779
propagate_nothrow (void)
Link Here
|
| 1773 |
int i; |
1773 |
int i; |
| 1774 |
struct ipa_dfs_info * w_info; |
1774 |
struct ipa_dfs_info * w_info; |
| 1775 |
|
1775 |
|
| 1776 |
order_pos = ipa_reduced_postorder (order, true, false, |
1776 |
order_pos = ipa_reduced_postorder (order, true, |
| 1777 |
ignore_edge_for_nothrow); |
1777 |
ignore_edge_for_nothrow); |
| 1778 |
if (dump_file) |
1778 |
if (dump_file) |
| 1779 |
{ |
1779 |
{ |
| 1780 |
-- a/gcc/ipa-reference.c |
1780 |
++ b/gcc/ipa-reference.c |
|
Lines 728-734
propagate (void)
Link Here
|
| 728 |
the global information. All the nodes within a cycle will have |
728 |
the global information. All the nodes within a cycle will have |
| 729 |
the same info so we collapse cycles first. Then we can do the |
729 |
the same info so we collapse cycles first. Then we can do the |
| 730 |
propagation in one pass from the leaves to the roots. */ |
730 |
propagation in one pass from the leaves to the roots. */ |
| 731 |
order_pos = ipa_reduced_postorder (order, true, true, ignore_edge_p); |
731 |
order_pos = ipa_reduced_postorder (order, true, ignore_edge_p); |
| 732 |
if (dump_file) |
732 |
if (dump_file) |
| 733 |
ipa_print_order (dump_file, "reduced", order, order_pos); |
733 |
ipa_print_order (dump_file, "reduced", order, order_pos); |
| 734 |
|
734 |
|
| 735 |
-- a/gcc/ipa-utils.c |
735 |
++ b/gcc/ipa-utils.c |
|
Lines 63-69
struct searchc_env {
Link Here
|
| 63 |
int order_pos; |
63 |
int order_pos; |
| 64 |
splay_tree nodes_marked_new; |
64 |
splay_tree nodes_marked_new; |
| 65 |
bool reduce; |
65 |
bool reduce; |
| 66 |
bool allow_overwritable; |
|
|
| 67 |
int count; |
66 |
int count; |
| 68 |
}; |
67 |
}; |
| 69 |
|
68 |
|
|
Lines 105-111
searchc (struct searchc_env* env, struct cgraph_node *v,
Link Here
|
| 105 |
|
104 |
|
| 106 |
if (w->aux |
105 |
if (w->aux |
| 107 |
&& (avail > AVAIL_INTERPOSABLE |
106 |
&& (avail > AVAIL_INTERPOSABLE |
| 108 |
|| (env->allow_overwritable && avail == AVAIL_INTERPOSABLE))) |
107 |
|| avail == AVAIL_INTERPOSABLE)) |
| 109 |
{ |
108 |
{ |
| 110 |
w_info = (struct ipa_dfs_info *) w->aux; |
109 |
w_info = (struct ipa_dfs_info *) w->aux; |
| 111 |
if (w_info->new_node) |
110 |
if (w_info->new_node) |
|
Lines 162-168
searchc (struct searchc_env* env, struct cgraph_node *v,
Link Here
|
| 162 |
|
161 |
|
| 163 |
int |
162 |
int |
| 164 |
ipa_reduced_postorder (struct cgraph_node **order, |
163 |
ipa_reduced_postorder (struct cgraph_node **order, |
| 165 |
bool reduce, bool allow_overwritable, |
164 |
bool reduce, |
| 166 |
bool (*ignore_edge) (struct cgraph_edge *)) |
165 |
bool (*ignore_edge) (struct cgraph_edge *)) |
| 167 |
{ |
166 |
{ |
| 168 |
struct cgraph_node *node; |
167 |
struct cgraph_node *node; |
|
Lines 175-189
ipa_reduced_postorder (struct cgraph_node **order,
Link Here
|
| 175 |
env.nodes_marked_new = splay_tree_new (splay_tree_compare_ints, 0, 0); |
174 |
env.nodes_marked_new = splay_tree_new (splay_tree_compare_ints, 0, 0); |
| 176 |
env.count = 1; |
175 |
env.count = 1; |
| 177 |
env.reduce = reduce; |
176 |
env.reduce = reduce; |
| 178 |
env.allow_overwritable = allow_overwritable; |
|
|
| 179 |
|
177 |
|
| 180 |
FOR_EACH_DEFINED_FUNCTION (node) |
178 |
FOR_EACH_DEFINED_FUNCTION (node) |
| 181 |
{ |
179 |
{ |
| 182 |
enum availability avail = node->get_availability (); |
180 |
enum availability avail = node->get_availability (); |
| 183 |
|
181 |
|
| 184 |
if (avail > AVAIL_INTERPOSABLE |
182 |
if (avail > AVAIL_INTERPOSABLE |
| 185 |
|| (allow_overwritable |
183 |
|| avail == AVAIL_INTERPOSABLE) |
| 186 |
&& (avail == AVAIL_INTERPOSABLE))) |
|
|
| 187 |
{ |
184 |
{ |
| 188 |
/* Reuse the info if it is already there. */ |
185 |
/* Reuse the info if it is already there. */ |
| 189 |
struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux; |
186 |
struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux; |
| 190 |
-- a/gcc/ipa-utils.h |
187 |
++ b/gcc/ipa-utils.h |
|
Lines 36-42
struct ipa_dfs_info {
Link Here
|
| 36 |
|
36 |
|
| 37 |
/* In ipa-utils.c */ |
37 |
/* In ipa-utils.c */ |
| 38 |
void ipa_print_order (FILE*, const char *, struct cgraph_node**, int); |
38 |
void ipa_print_order (FILE*, const char *, struct cgraph_node**, int); |
| 39 |
int ipa_reduced_postorder (struct cgraph_node **, bool, bool, |
39 |
int ipa_reduced_postorder (struct cgraph_node **, bool, |
| 40 |
bool (*ignore_edge) (struct cgraph_edge *)); |
40 |
bool (*ignore_edge) (struct cgraph_edge *)); |
| 41 |
void ipa_free_postorder_info (void); |
41 |
void ipa_free_postorder_info (void); |
| 42 |
vec<cgraph_node *> ipa_get_nodes_in_cycle (struct cgraph_node *); |
42 |
vec<cgraph_node *> ipa_get_nodes_in_cycle (struct cgraph_node *); |
| 43 |
-- /dev/null |
43 |
++ b/gcc/testsuite/g++.dg/ipa/pr89009.C |
|
Line 0
Link Here
|
| 0 |
- |
1 |
/* PR ipa/89009 */ |
|
|
2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-fvisibility=hidden -fpic -O2 -fno-inline" } */ |
| 4 |
|
| 5 |
#pragma GCC visibility push(default) |
| 6 |
void foo1() { __builtin_printf ("foo\n"); } |
| 7 |
#pragma GCC visibility pop |
| 8 |
void foo2() { __builtin_printf ("foo\n"); } |
| 9 |
|
| 10 |
int main() { foo2(); return 0; } |
| 11 |
|
| 12 |
/* { dg-output "foo" } */ |