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

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Untested patch to turn things into true predicate when running out of space is:
--- gcc/ipa-inline-analysis.c.jj    2014-02-03 08:53:12.000000000 +0100
+++ gcc/ipa-inline-analysis.c    2014-02-05 08:01:57.093878954 +0100
@@ -310,7 +310,7 @@ add_clause (conditions conditions, struc
   if (false_predicate_p (p))
     return;

-  /* No one should be sily enough to add false into nontrivial clauses.  */
+  /* No one should be silly enough to add false into nontrivial clauses.  */
   gcc_checking_assert (!(clause & (1 << predicate_false_condition)));

   /* Look where to insert the clause.  At the same time prune out
@@ -372,9 +372,13 @@ add_clause (conditions conditions, struc
     }


-  /* We run out of variants.  Be conservative in positive direction.  */
+  /* We run out of variants.  Conservatively turn clause into true
+     predicate.  */
   if (i2 == MAX_CLAUSES)
-    return;
+    {
+      p->clause[0] = 0;
+      return;
+    }
   /* Keep clauses in decreasing order. This makes equivalence testing easy. 
*/
   p->clause[i2 + 1] = 0;
   if (insert_here >= 0)
@@ -412,6 +416,8 @@ and_predicates (conditions conditions,
     {
       gcc_checking_assert (i < MAX_CLAUSES);
       add_clause (conditions, &out, p2->clause[i]);
+      if (true_predicate_p (&out))
+    break;
     }
   return out;
 }
@@ -459,6 +465,8 @@ or_predicates (conditions conditions,
       {
     gcc_checking_assert (i < MAX_CLAUSES && j < MAX_CLAUSES);
     add_clause (conditions, &out, p->clause[i] | p2->clause[j]);
+    if (true_predicate_p (&out))
+      return out;
       }
   return out;
 }
@@ -1035,7 +1043,7 @@ inline_node_removal_hook (struct cgraph_
   memset (info, 0, sizeof (inline_summary_t));
 }

-/* Remap predicate P of former function to be predicate of duplicated
functoin.
+/* Remap predicate P of former function to be predicate of duplicated
function.
    POSSIBLE_TRUTHS is clause of possible truths in the duplicated node,
    INFO is inline summary of the duplicated node.  */

and fixes the testcase.  Yet another possibility would be to keep
add_clause/{and,or}_predicates as is and just add comment that the oscillation
is possible due to using only a subset of the predicates, and during
compute_bb_predicates just wait until all basic blocks have bb->aux set, then
do a couple of iterations of the main loop after that and finally either just
terminate, or change the oscillating bb's into true predicate.

Reply via email to