From 3494e738cf975b8220002a25c9de4d616a60ac46 Mon Sep 17 00:00:00 2001
From: Jan Hubicka <hubicka@ucw.cz>
Date: Tue, 23 May 2017 14:20:05 +0200
Subject: [PATCH] ipa-fnsummary.c (estimate_node_size_and_time): Do not sanity
 check that nonconst implies exec.

	* ipa-fnsummary.c (estimate_node_size_and_time): Do not sanity check
	that nonconst implies exec.

From-SVN: r248366
---
 gcc/ChangeLog       | 5 +++++
 gcc/ipa-fnsummary.c | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b45cd01b68cb..e5d00ec3bead 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-23  Jan Hubicka  <hubicka@ucw.cz>
+
+	* ipa-fnsummary.c (estimate_node_size_and_time): Do not sanity check
+	that nonconst implies exec.
+
 2017-05-23  Jan Hubicka  <hubicka@ucw.cz>
 
 	* ipa-inline-analysis.c (cgraph_2edge_hook_list, cgraph_edge_hook_list,
diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
index d9006d1e2189..0a5abb547804 100644
--- a/gcc/ipa-fnsummary.c
+++ b/gcc/ipa-fnsummary.c
@@ -2738,11 +2738,14 @@ estimate_node_size_and_time (struct cgraph_node *node,
 
   for (i = 0; vec_safe_iterate (info->size_time_table, i, &e); i++)
     {
-      bool nonconst = e->nonconst_predicate.evaluate (possible_truths);
       bool exec = e->exec_predicate.evaluate (nonspec_possible_truths);
-      gcc_assert (!nonconst || exec);
+
+      /* Because predicates are conservative, it can happen that nonconst is 1
+	 but exec is 0.  */
       if (exec)
         {
+          bool nonconst = e->nonconst_predicate.evaluate (possible_truths);
+
 	  gcc_checking_assert (e->time >= 0);
 	  gcc_checking_assert (time >= 0);
 
-- 
GitLab