ipa-inline-analysis.c (estimate_function_body_sizes): Recompute body size uncondition...
authorJan Hubicka <hubicka@ucw.cz>
Sun, 7 May 2017 22:21:05 +0000 (00:21 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 7 May 2017 22:21:05 +0000 (22:21 +0000)
* ipa-inline-analysis.c (estimate_function_body_sizes): Recompute
body size unconditionally.

From-SVN: r247729

gcc/ChangeLog
gcc/ipa-inline-analysis.c

index 4adb9a83f0a0f806dcf0c804d59dbc83466f8c7d..2f1de244a5ecc743289af90d50b2c140b97f8c52 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-05  Jan Hubicka  <hubicka@ucw.cz>
+
+       * ipa-inline-analysis.c (estimate_function_body_sizes): Recompute
+       body size unconditionally.
+
 2017-05-07  Jeff Law  <law@redhat.com>
 
        Revert:
index ec6f2ac69722f9df066e59c44d5269e18046ee07..d44191ade00d0f573406f17ec7b3305b58a522d7 100644 (file)
@@ -2994,6 +2994,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
   inline_summaries->get (node)->self_size = size;
   nonconstant_names.release ();
   ipa_release_body_info (&fbi);
+  inline_update_overall_summary (node);
   if (opt_for_fn (node->decl, optimize))
     {
       if (!early)
@@ -3119,12 +3120,13 @@ compute_inline_parameters (struct cgraph_node *node, bool early)
   info->size = info->self_size;
   info->stack_frame_offset = 0;
   info->estimated_stack_size = info->estimated_self_stack_size;
-  if (flag_checking)
-    {
-      inline_update_overall_summary (node);
-      gcc_assert (!(info->time - info->self_time).to_int ()
-                 && info->size == info->self_size);
-    }
+
+  /* Code above should compute exactly the same result as
+     inline_update_overall_summary but because computation happens in
+     different order the roundoff errors result in slight changes.  */
+  inline_update_overall_summary (node);
+  gcc_assert (!(info->time - info->self_time).to_int ()
+             && info->size == info->self_size);
 }