summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-25 09:08:20 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-25 09:08:20 +0000
commit83caf9ff7e5307a3982af5efe4885524b0be0d88 (patch)
treed6f63deed97bf900176e1ac53286dece43a90300
parente11a63e8f4035e815106ef6b0a7a7f6fd6b5aa12 (diff)
downloadgcc-83caf9ff7e5307a3982af5efe4885524b0be0d88.tar.gz
* ipa-inline-analysis.c: Include gimplify.h
(set_cond_stmt_execution_predicate, set_switch_stmt_execution_predicate): Be sure to not leak locations to function body. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230857 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/ipa-inline-analysis.c16
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9504817e269..3ec9ab7008f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-24 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-inline-analysis.c: Include gimplify.h
+ (set_cond_stmt_execution_predicate,
+ set_switch_stmt_execution_predicate): Be sure to not leak locations
+ to function body.
+
2015-11-25 Jakub Jelinek <jakub@redhat.com>
PR target/67089
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 8c8b8e3af84..cf7766b7d14 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -94,6 +94,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-utils.h"
#include "cilk.h"
#include "cfgexpand.h"
+#include "gimplify.h"
/* Estimate runtime of function can easilly run into huge numbers with many
nested loops. Be sure we can compute time * INLINE_SIZE_SCALE * 2 in an
@@ -1773,9 +1774,9 @@ set_cond_stmt_execution_predicate (struct ipa_func_body_info *fbi,
unordered one. Be sure it is not confused with NON_CONSTANT. */
if (this_code != ERROR_MARK)
{
- struct predicate p = add_condition (summary, index, &aggpos,
- this_code,
- gimple_cond_rhs (last));
+ struct predicate p = add_condition
+ (summary, index, &aggpos, this_code,
+ unshare_expr_without_location (gimple_cond_rhs (last)));
e->aux = edge_predicate_pool.allocate ();
*(struct predicate *) e->aux = p;
}
@@ -1861,12 +1862,15 @@ set_switch_stmt_execution_predicate (struct ipa_func_body_info *fbi,
if (!min && !max)
p = true_predicate ();
else if (!max)
- p = add_condition (summary, index, &aggpos, EQ_EXPR, min);
+ p = add_condition (summary, index, &aggpos, EQ_EXPR,
+ unshare_expr_without_location (min));
else
{
struct predicate p1, p2;
- p1 = add_condition (summary, index, &aggpos, GE_EXPR, min);
- p2 = add_condition (summary, index, &aggpos, LE_EXPR, max);
+ p1 = add_condition (summary, index, &aggpos, GE_EXPR,
+ unshare_expr_without_location (min));
+ p2 = add_condition (summary, index, &aggpos, LE_EXPR,
+ unshare_expr_without_location (max));
p = and_predicates (summary->conds, &p1, &p2);
}
*(struct predicate *) e->aux