re PR ipa/65008 (ICE: in estimate_edge_growth, at ipa-inline.h:298 with -O2)
authorMarek Polacek <polacek@redhat.com>
Thu, 26 Feb 2015 18:59:50 +0000 (18:59 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 26 Feb 2015 18:59:50 +0000 (18:59 +0000)
PR ipa/65008
* ipa-inline.c (early_inliner): Recompute inline parameters.

* g++.dg/ipa/pr65008.C: New test.

From-SVN: r221025

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

index f651903d8e80592e5819e871f78d39347e27d2b7..4fa8ad664788542c41ce8f50bf3c7fd532a2494c 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-26  Marek Polacek  <polacek@redhat.com>
+
+       PR ipa/65008
+       * ipa-inline.c (early_inliner): Recompute inline parameters.
+
 2015-02-26  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR target/65171
index 025f7fc5f6b19733c5c3ba69d1e75a5f230c8aa6..c445f0a7a5d5d13c111b57917872e5e8ac2a1c5e 100644 (file)
@@ -2559,6 +2559,19 @@ early_inliner (function *fun)
        {
          timevar_push (TV_INTEGRATION);
          todo |= optimize_inline_calls (current_function_decl);
+         /* optimize_inline_calls call above might have introduced new
+            statements that don't have inline parameters computed.  */
+         for (edge = node->callees; edge; edge = edge->next_callee)
+           {
+             if (inline_edge_summary_vec.length () > (unsigned) edge->uid)
+               {
+                 struct inline_edge_summary *es = inline_edge_summary (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);
+               }
+           }
          inline_update_overall_summary (node);
          inlined = false;
          timevar_pop (TV_INTEGRATION);
index c9789d99b4fbb8fcae4a088bbd77ef408ec1d0ad..be82a66b687d421c9cecd62d8fc371c7f28730b0 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-26  Marek Polacek  <polacek@redhat.com>
+
+       PR ipa/65008
+       * g++.dg/ipa/pr65008.C: New test.
+
 2015-02-26  Tom de Vries  <tom@codesourcery.com>
 
        * lib/profopt.exp (profopt-target-cleanup): New proc.
diff --git a/gcc/testsuite/g++.dg/ipa/pr65008.C b/gcc/testsuite/g++.dg/ipa/pr65008.C
new file mode 100644 (file)
index 0000000..29b3a2f
--- /dev/null
@@ -0,0 +1,19 @@
+// PR ipa/65008
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct A
+{
+  A ();
+  virtual void foo () {}
+};
+
+static inline int __attribute__ ((always_inline)) call_foo (A *a)
+{
+  a->foo ();
+}
+
+A::A ()
+{
+  call_foo (this);
+}