From 0e8d6eb79458dbf590d4464496f8a55663813c79 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 3 May 2017 00:35:24 +0200 Subject: [PATCH] ipa-inline-analysis.c (estimate_node_size_and_time): Allow roundoff errors when comparing specialized and unspecialized times. * ipa-inline-analysis.c (estimate_node_size_and_time): Allow roundoff errors when comparing specialized and unspecialized times. From-SVN: r247528 --- gcc/ChangeLog | 10 ++++++++++ gcc/ipa-inline-analysis.c | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2b6dfb3a45c..61a33210c0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-05-02 Jan Hubicka + + * ipa-inline-analysis.c (estimate_node_size_and_time): Allow roundoff + errors when comparing specialized and unspecialized times. + 2017-05-02 David Malcolm * diagnostic-show-locus.c @@ -354,6 +359,11 @@ if the only reason why modified_in_p returned true is that addr is SP based and set_insn is a push or pop. +2017-04-29 Jan Hubicka + + * ipa-inline.c (compute_inlined_call_time): Remove now unnecesary + overflow check. + 2017-04-29 Jan Hubicka PR ipa/79224 diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 81183cffdfa..929de8e9791 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -3422,7 +3422,15 @@ estimate_node_size_and_time (struct cgraph_node *node, min_size = (*info->entry)[0].size; gcc_checking_assert (size >= 0); gcc_checking_assert (time >= 0); - gcc_checking_assert (nonspecialized_time >= time); + /* nonspecialized_time should be always bigger than specialized time. + Roundoff issues however may get into the way. */ + gcc_checking_assert ((nonspecialized_time - time) >= -1); + + /* Roundoff issues may make specialized time bigger than nonspecialized + time. We do not really want that to happen because some heurstics + may get confused by seeing negative speedups. */ + if (time > nonspecialized_time) + time = nonspecialized_time; if (info->loop_iterations && !evaluate_predicate (info->loop_iterations, possible_truths)) -- 2.30.2