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 0fc109dc783db94ce8bb41ba5d10ac20af069e7b..3b700e0f1edae37ed9b89e33315a31a63a40cb01 100644 (file)
@@ -1,3 +1,10 @@
+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,
index 0238de2dac8e205ea508ae389b490e3a4320dfc1..b0d589081d8d6ce5dcdb49485261b77e4d3ae533 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 14517c029fb4c991f2037961767ec7bc21d28d6d..727cf63e10a75fc5a6bd0480663d35de784fffd8 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 *>