ipa-inline.h (ipa_call_summary): Turn sizes into signed; add ctor.
authorJan Hubicka <hubicka@ucw.cz>
Fri, 19 May 2017 09:36:56 +0000 (11:36 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 19 May 2017 09:36:56 +0000 (09:36 +0000)
* ipa-inline.h (ipa_call_summary): Turn sizes into signed;
add ctor.
* ipa-inline.c (want_inline_small_function_p): Do not cast to
unsigned.

From-SVN: r248263

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

index 0fc109d..3b700e0 100644 (file)
@@ -1,5 +1,12 @@
 2017-05-19  Jan Hubicka  <hubicka@ucw.cz>
 
+       * ipa-inline.h (ipa_call_summary): Turn sizes into signed;
+       add ctor.
+       * ipa-inline.c (want_inline_small_function_p): Do not cast to
+       unsigned.
+
+2017-05-19  Jan Hubicka  <hubicka@ucw.cz>
+
        * ipa-inline-analysis.c (cgraph_2edge_hook_list, cgraph_edge_hook_list,
        inline_edge_removal_hook, inline_edge_duplication_hook): Remove.
        (inline_edge_summary_vec): Turn into ...
index 0238de2..b0d5890 100644 (file)
@@ -723,7 +723,7 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
           && (!e->count || !e->maybe_hot_p ()))
           && inline_summaries->get (callee)->min_size
                - ipa_call_summaries->get (e)->call_stmt_size
-             > (unsigned)MAX (MAX_INLINE_INSNS_SINGLE, MAX_INLINE_INSNS_AUTO))
+             > MAX (MAX_INLINE_INSNS_SINGLE, MAX_INLINE_INSNS_AUTO))
     {
       e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
       want_inline = false;
@@ -731,7 +731,7 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
   else if ((DECL_DECLARED_INLINE_P (callee->decl) || e->count)
           && inline_summaries->get (callee)->min_size
                - ipa_call_summaries->get (e)->call_stmt_size
-             > (unsigned)16 * MAX_INLINE_INSNS_SINGLE)
+             > 16 * MAX_INLINE_INSNS_SINGLE)
     {
       e->inline_failed = (DECL_DECLARED_INLINE_P (callee->decl)
                          ? CIF_MAX_INLINE_INSNS_SINGLE_LIMIT
index 14517c0..727cf63 100644 (file)
@@ -189,10 +189,18 @@ struct ipa_call_summary
   /* Vector indexed by parameters.  */
   vec<inline_param_summary> param;
   /* Estimated size and time of the call statement.  */
-  unsigned int call_stmt_size;
-  unsigned int call_stmt_time;
+  int call_stmt_size;
+  int call_stmt_time;
   /* Depth of loop nest, 0 means no nesting.  */
   unsigned int loop_depth;
+  
+  /* Keep all field empty so summary dumping works during its computation.
+     This is useful for debugging.  */
+  ipa_call_summary ()
+    : predicate (NULL), param (vNULL), call_stmt_size (0), call_stmt_time (0),
+      loop_depth (0)
+    {
+    }
 };
 
 class ipa_call_summary_t: public call_summary <ipa_call_summary *>