http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55683



--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-14 
10:42:39 UTC ---

Happens once in the unreduced testcase.  The following will maybe give us

testcases with even more off values (off-by-1 happens quite often):



Index: gcc/ipa-inline-transform.c

===================================================================

--- gcc/ipa-inline-transform.c  (revision 194496)

+++ gcc/ipa-inline-transform.c  (working copy)

@@ -211,11 +211,6 @@ inline_call (struct cgraph_edge *e, bool

   struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee,

NULL);

   bool new_edges_found = false;



-#ifdef ENABLE_CHECKING

-  int estimated_growth = estimate_edge_growth (e);

-  bool predicated = inline_edge_summary (e)->predicate != NULL;

-#endif

-

   /* Don't inline inlined edges.  */

   gcc_assert (e->inline_failed);

   /* Don't even think of inlining inline clone.  */

@@ -263,11 +258,22 @@ inline_call (struct cgraph_edge *e, bool

 #ifdef ENABLE_CHECKING

   /* Verify that estimated growth match real growth.  Allow off-by-one

      error due to INLINE_SIZE_SCALE roudoff errors.  */

-  gcc_assert (!update_overall_summary || !overall_size

-             || abs (estimated_growth - (new_size - old_size)) <= 1

-             /* FIXME: a hack.  Edges with false predicate are accounted

-                wrong, we should remove them from callgraph.  */

-             || predicated);

+  if (update_overall_summary && overall_size)

+    {

+      int estimated_growth = estimate_edge_growth (e);

+      bool predicated = inline_edge_summary (e)->predicate != NULL;

+

+      if (dump_file && (dump_flags & TDF_DETAILS)

+         && (estimated_growth - (new_size - old_size)) != 0)

+       {

+         /* FIXME: Edges with false predicate are accounted

+            wrong, we should remove them from callgraph.  */

+         fprintf (dump_file, " Estimated growth is off by %d%s",

+                  estimated_growth - (new_size - old_size),

+                  predicated ? " (predicated)\n" : "\n");

+       }

+      gcc_assert (abs (estimated_growth - (new_size - old_size)) <= 2);

+    }

 #endif



   /* Account the change of overall unit size; external functions will be

Reply via email to