Commit 45272fd2 by Martin Liska Committed by Martin Liska

Construct ipa_reduced_postorder always for overwritable (PR ipa/89009).

2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* ipa-cp.c (build_toporder_info): Remove usage of a param.
	* ipa-inline.c (inline_small_functions): Likewise.
	* ipa-pure-const.c (propagate_pure_const): Likewise.
	(propagate_nothrow): Likewise.
	* ipa-reference.c (propagate): Likewise.
	* ipa-utils.c (struct searchc_env): Remove unused field.
	(searchc): Always search across AVAIL_INTERPOSABLE.
	(ipa_reduced_postorder): Always allow AVAIL_INTERPOSABLE as
	the only called IPA pure const can properly not propagate
	across interposable boundary.
	* ipa-utils.h (ipa_reduced_postorder): Remove param.
2019-02-11  Martin Liska  <mliska@suse.cz>

	PR ipa/89009
	* g++.dg/ipa/pr89009.C: New test.

From-SVN: r268762
parent d29cce74
2019-02-11 Martin Liska <mliska@suse.cz>
PR ipa/89009
* ipa-cp.c (build_toporder_info): Remove usage of a param.
* ipa-inline.c (inline_small_functions): Likewise.
* ipa-pure-const.c (propagate_pure_const): Likewise.
(propagate_nothrow): Likewise.
* ipa-reference.c (propagate): Likewise.
* ipa-utils.c (struct searchc_env): Remove unused field.
(searchc): Always search across AVAIL_INTERPOSABLE.
(ipa_reduced_postorder): Always allow AVAIL_INTERPOSABLE as
the only called IPA pure const can properly not propagate
across interposable boundary.
* ipa-utils.h (ipa_reduced_postorder): Remove param.
2019-02-11 Chung-Ju Wu <jasonwucj@gmail.com> 2019-02-11 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.md (call_internal, call_value_internal, * config/nds32/nds32.md (call_internal, call_value_internal,
......
...@@ -815,7 +815,7 @@ build_toporder_info (struct ipa_topo_info *topo) ...@@ -815,7 +815,7 @@ build_toporder_info (struct ipa_topo_info *topo)
topo->stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count); topo->stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count);
gcc_checking_assert (topo->stack_top == 0); gcc_checking_assert (topo->stack_top == 0);
topo->nnodes = ipa_reduced_postorder (topo->order, true, true, NULL); topo->nnodes = ipa_reduced_postorder (topo->order, true, NULL);
} }
/* Free information about strongly connected components and the arrays in /* Free information about strongly connected components and the arrays in
......
...@@ -1778,7 +1778,7 @@ inline_small_functions (void) ...@@ -1778,7 +1778,7 @@ inline_small_functions (void)
metrics. */ metrics. */
max_count = profile_count::uninitialized (); max_count = profile_count::uninitialized ();
ipa_reduced_postorder (order, true, true, NULL); ipa_reduced_postorder (order, true, NULL);
free (order); free (order);
FOR_EACH_DEFINED_FUNCTION (node) FOR_EACH_DEFINED_FUNCTION (node)
......
...@@ -1422,7 +1422,7 @@ propagate_pure_const (void) ...@@ -1422,7 +1422,7 @@ propagate_pure_const (void)
bool remove_p = false; bool remove_p = false;
bool has_cdtor; bool has_cdtor;
order_pos = ipa_reduced_postorder (order, true, false, order_pos = ipa_reduced_postorder (order, true,
ignore_edge_for_pure_const); ignore_edge_for_pure_const);
if (dump_file) if (dump_file)
{ {
...@@ -1751,7 +1751,7 @@ propagate_nothrow (void) ...@@ -1751,7 +1751,7 @@ propagate_nothrow (void)
int i; int i;
struct ipa_dfs_info * w_info; struct ipa_dfs_info * w_info;
order_pos = ipa_reduced_postorder (order, true, false, order_pos = ipa_reduced_postorder (order, true,
ignore_edge_for_nothrow); ignore_edge_for_nothrow);
if (dump_file) if (dump_file)
{ {
......
...@@ -712,7 +712,7 @@ propagate (void) ...@@ -712,7 +712,7 @@ propagate (void)
the global information. All the nodes within a cycle will have the global information. All the nodes within a cycle will have
the same info so we collapse cycles first. Then we can do the the same info so we collapse cycles first. Then we can do the
propagation in one pass from the leaves to the roots. */ propagation in one pass from the leaves to the roots. */
order_pos = ipa_reduced_postorder (order, true, true, ignore_edge_p); order_pos = ipa_reduced_postorder (order, true, ignore_edge_p);
if (dump_file) if (dump_file)
ipa_print_order (dump_file, "reduced", order, order_pos); ipa_print_order (dump_file, "reduced", order, order_pos);
......
...@@ -63,7 +63,6 @@ struct searchc_env { ...@@ -63,7 +63,6 @@ struct searchc_env {
int order_pos; int order_pos;
splay_tree nodes_marked_new; splay_tree nodes_marked_new;
bool reduce; bool reduce;
bool allow_overwritable;
int count; int count;
}; };
...@@ -105,7 +104,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v, ...@@ -105,7 +104,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v,
if (w->aux if (w->aux
&& (avail > AVAIL_INTERPOSABLE && (avail > AVAIL_INTERPOSABLE
|| (env->allow_overwritable && avail == AVAIL_INTERPOSABLE))) || avail == AVAIL_INTERPOSABLE))
{ {
w_info = (struct ipa_dfs_info *) w->aux; w_info = (struct ipa_dfs_info *) w->aux;
if (w_info->new_node) if (w_info->new_node)
...@@ -162,7 +161,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v, ...@@ -162,7 +161,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v,
int int
ipa_reduced_postorder (struct cgraph_node **order, ipa_reduced_postorder (struct cgraph_node **order,
bool reduce, bool allow_overwritable, bool reduce,
bool (*ignore_edge) (struct cgraph_edge *)) bool (*ignore_edge) (struct cgraph_edge *))
{ {
struct cgraph_node *node; struct cgraph_node *node;
...@@ -175,15 +174,13 @@ ipa_reduced_postorder (struct cgraph_node **order, ...@@ -175,15 +174,13 @@ ipa_reduced_postorder (struct cgraph_node **order,
env.nodes_marked_new = splay_tree_new (splay_tree_compare_ints, 0, 0); env.nodes_marked_new = splay_tree_new (splay_tree_compare_ints, 0, 0);
env.count = 1; env.count = 1;
env.reduce = reduce; env.reduce = reduce;
env.allow_overwritable = allow_overwritable;
FOR_EACH_DEFINED_FUNCTION (node) FOR_EACH_DEFINED_FUNCTION (node)
{ {
enum availability avail = node->get_availability (); enum availability avail = node->get_availability ();
if (avail > AVAIL_INTERPOSABLE if (avail > AVAIL_INTERPOSABLE
|| (allow_overwritable || avail == AVAIL_INTERPOSABLE)
&& (avail == AVAIL_INTERPOSABLE)))
{ {
/* Reuse the info if it is already there. */ /* Reuse the info if it is already there. */
struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux; struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux;
......
...@@ -36,7 +36,7 @@ struct ipa_dfs_info { ...@@ -36,7 +36,7 @@ struct ipa_dfs_info {
/* In ipa-utils.c */ /* In ipa-utils.c */
void ipa_print_order (FILE*, const char *, struct cgraph_node**, int); void ipa_print_order (FILE*, const char *, struct cgraph_node**, int);
int ipa_reduced_postorder (struct cgraph_node **, bool, bool, int ipa_reduced_postorder (struct cgraph_node **, bool,
bool (*ignore_edge) (struct cgraph_edge *)); bool (*ignore_edge) (struct cgraph_edge *));
void ipa_free_postorder_info (void); void ipa_free_postorder_info (void);
vec<cgraph_node *> ipa_get_nodes_in_cycle (struct cgraph_node *); vec<cgraph_node *> ipa_get_nodes_in_cycle (struct cgraph_node *);
......
2019-02-11 Martin Liska <mliska@suse.cz>
PR ipa/89009
* g++.dg/ipa/pr89009.C: New test.
2019-02-10 Thomas Koenig <tkoenig@gcc.gnu.org> 2019-02-10 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71723 PR fortran/71723
......
/* PR ipa/89009 */
/* { dg-do run } */
/* { dg-options "-fvisibility=hidden -fpic -O2 -fno-inline" } */
#pragma GCC visibility push(default)
void foo1() { __builtin_printf ("foo\n"); }
#pragma GCC visibility pop
void foo2() { __builtin_printf ("foo\n"); }
int main() { foo2(); return 0; }
/* { dg-output "foo" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment