]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r268762
authorMartin Liska <mliska@suse.cz>
Fri, 15 Feb 2019 10:58:49 +0000 (11:58 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 15 Feb 2019 10:58:49 +0000 (10:58 +0000)
2019-02-15  Martin Liska  <mliska@suse.cz>

Backport from mainline
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-15  Martin Liska  <mliska@suse.cz>

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

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

From-SVN: r268937

gcc/ChangeLog
gcc/ipa-cp.c
gcc/ipa-inline.c
gcc/ipa-pure-const.c
gcc/ipa-reference.c
gcc/ipa-utils.c
gcc/ipa-utils.h
gcc/testsuite/ChangeLog

index 55d41b89dfd2ca35038e620da17edb23e9b7a173..00435fe9852251592961e9f533c702373ca23e23 100644 (file)
@@ -1,3 +1,21 @@
+2019-02-15  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       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  Stefan Agner  <stefan@agner.ch>
 
        Backport from mainline.
index 3902d3a8a006827496c70a8e2e5b8146669d8bfe..b42cfb0f6e0268000966b3f74b88dcddf11896a3 100644 (file)
@@ -810,7 +810,7 @@ build_toporder_info (struct ipa_topo_info *topo)
   topo->stack = XCNEWVEC (struct cgraph_node *, symtab->cgraph_count);
 
   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
index 0c25635f4c8b7c7c4dbfb1feb809902994411d74..b520c6393f4f96735b5e43fc7da64edbfd3453e3 100644 (file)
@@ -1745,7 +1745,7 @@ inline_small_functions (void)
      metrics.  */
 
   max_count = 0;
-  ipa_reduced_postorder (order, true, true, NULL);
+  ipa_reduced_postorder (order, true, NULL);
   free (order);
 
   FOR_EACH_DEFINED_FUNCTION (node)
index e457166ea395ea078c8f55232e049be5e57021ba..5a11919dd5c25ee5c17cb0e6010844f635b8b5bb 100644 (file)
@@ -1233,7 +1233,7 @@ propagate_pure_const (void)
   bool remove_p = false;
   bool has_cdtor;
 
-  order_pos = ipa_reduced_postorder (order, true, false,
+  order_pos = ipa_reduced_postorder (order, true,
                                     ignore_edge_for_pure_const);
   if (dump_file)
     {
@@ -1566,7 +1566,7 @@ propagate_nothrow (void)
   int i;
   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);
   if (dump_file)
     {
index f47d0cc51e1d434dfdcb521274f7be11b3d645df..ccbfa078deb77cad463396e5b78162c3c2a905d6 100644 (file)
@@ -730,7 +730,7 @@ propagate (void)
      the global information.  All the nodes within a cycle will have
      the same info so we collapse cycles first.  Then we can do the
      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)
     ipa_print_order (dump_file, "reduced", order, order_pos);
 
index f7dd29f925c36867907025c57dca3354c9858a97..3fb0215090484661d2f4c7f5330b335c8bb1a534 100644 (file)
@@ -63,7 +63,6 @@ struct searchc_env {
   int order_pos;
   splay_tree nodes_marked_new;
   bool reduce;
-  bool allow_overwritable;
   int count;
 };
 
@@ -105,7 +104,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v,
 
       if (w->aux
          && (avail > AVAIL_INTERPOSABLE
-             || (env->allow_overwritable && avail == AVAIL_INTERPOSABLE)))
+             || avail == AVAIL_INTERPOSABLE))
        {
          w_info = (struct ipa_dfs_info *) w->aux;
          if (w_info->new_node)
@@ -162,7 +161,7 @@ searchc (struct searchc_env* env, struct cgraph_node *v,
 
 int
 ipa_reduced_postorder (struct cgraph_node **order,
-                      bool reduce, bool allow_overwritable,
+                      bool reduce,
                       bool (*ignore_edge) (struct cgraph_edge *))
 {
   struct cgraph_node *node;
@@ -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.count = 1;
   env.reduce = reduce;
-  env.allow_overwritable = allow_overwritable;
 
   FOR_EACH_DEFINED_FUNCTION (node)
     {
       enum availability avail = node->get_availability ();
 
       if (avail > AVAIL_INTERPOSABLE
-         || (allow_overwritable
-             && (avail == AVAIL_INTERPOSABLE)))
+         || avail == AVAIL_INTERPOSABLE)
        {
          /* Reuse the info if it is already there.  */
          struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux;
index e992f65948b27e2b2900daf54ea55f8b8dedfcc8..f8a25a6786f00d3268fdcc1d3534bce22ba10126 100644 (file)
@@ -36,7 +36,7 @@ struct ipa_dfs_info {
 
 /* In ipa-utils.c  */
 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 *));
 void ipa_free_postorder_info (void);
 vec<cgraph_node *> ipa_get_nodes_in_cycle (struct cgraph_node *);
index 5eea6ff9dafd62a1a88b050aa2f2d4b87f2db7dd..5bc88b73e720bdd2dfec670d9c1546b98cc7cba2 100644 (file)
@@ -1,3 +1,11 @@
+2019-02-15  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       2019-02-11  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/89009
+       * g++.dg/ipa/pr89009.C: New test.
+
 2019-02-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.target/sparc/struct-ret-check-1.c: Add -fno-pie option.