Revert one ipa_call_summaries::get to get_create (PR ipa/86323).
authorMartin Liska <mliska@suse.cz>
Mon, 2 Jul 2018 07:04:01 +0000 (09:04 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 2 Jul 2018 07:04:01 +0000 (07:04 +0000)
2018-07-02  Martin Liska  <mliska@suse.cz>

        PR ipa/86323
* ipa-inline.c (early_inliner): Revert wrongly added ::get call.
2018-07-02  Martin Liska  <mliska@suse.cz>

        PR ipa/86323
* g++.dg/ipa/pr86323.C: New test.

From-SVN: r262297

gcc/ChangeLog
gcc/ipa-inline.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/pr86323.C [new file with mode: 0644]

index 64ed2f7e954d0324ea8e4fbe3b25c7a29ccb5e1b..bc9edec62477dc3e3e09e0b7ce3068d44a096cf2 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-02  Martin Liska  <mliska@suse.cz>
+
+        PR ipa/86323
+       * ipa-inline.c (early_inliner): Revert wrongly added ::get call.
+
 2018-07-02  David Malcolm  <dmalcolm@redhat.com>
 
        * dumpfile.c (dump_generic_expr_loc): Undo removal of this
index a62c1ffd3b0164dd3a6e71487ffb685f72be8fd0..a84d1d9ad3e45935eff51f00b8f6b5058a691c9e 100644 (file)
@@ -2802,14 +2802,11 @@ early_inliner (function *fun)
          for (edge = node->callees; edge; edge = edge->next_callee)
            {
              /* We have no summary for new bound store calls yet.  */
-             ipa_call_summary *es = ipa_call_summaries->get (edge);
-             if (es != NULL)
-               {
-                 es->call_stmt_size
-                   = estimate_num_insns (edge->call_stmt, &eni_size_weights);
-                 es->call_stmt_time
-                   = estimate_num_insns (edge->call_stmt, &eni_time_weights);
-               }
+             ipa_call_summary *es = ipa_call_summaries->get_create (edge);
+             es->call_stmt_size
+               = estimate_num_insns (edge->call_stmt, &eni_size_weights);
+             es->call_stmt_time
+               = estimate_num_insns (edge->call_stmt, &eni_time_weights);
 
              if (edge->callee->decl
                  && !gimple_check_call_matching_types (
index f8b82b5984b68f1de74ce013c5ee5f98037d1c33..967956fd86e4e7fdf9c1639e0ccb3d773c068d59 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-02  Martin Liska  <mliska@suse.cz>
+
+        PR ipa/86323
+       * g++.dg/ipa/pr86323.C: New test.
+
 2018-07-01  Tom de Vries  <tdevries@suse.de>
 
        revert:
diff --git a/gcc/testsuite/g++.dg/ipa/pr86323.C b/gcc/testsuite/g++.dg/ipa/pr86323.C
new file mode 100644 (file)
index 0000000..6632f35
--- /dev/null
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 --param max-early-inliner-iterations=5" } */
+
+char *s;
+namespace a {
+template <class ae> class af {
+public:
+  af(ae);
+};
+typedef af<char *> b;
+namespace ag {
+class ah {
+public:
+  void ai(b aj) { c(aj); }
+  virtual void c(b);
+};
+class d : public ah {
+  void c(b);
+};
+class e {
+  void f(bool);
+  void ai(b aj) { g.ai(aj); }
+  d g;
+};
+void d::c(b) {}
+void e::f(bool) { ai(s); }
+}
+}