[gcc/devel/c++-coroutines] ipa-inline: Adjust condition for caller_growth_limits
Iain D Sandoe
iains@gcc.gnu.org
Fri Jan 17 11:03:00 GMT 2020
https://gcc.gnu.org/g:6ac22177a085e0ba36c95e71cee8235cc8b12947
commit 6ac22177a085e0ba36c95e71cee8235cc8b12947
Author: Luo Xiong Hu <luoxhu@linux.ibm.com>
Date: Tue Jan 7 02:38:16 2020 +0000
ipa-inline: Adjust condition for caller_growth_limits
Inline should return failure either (newsize > param_large_function_insns)
OR (newsize > limit). Sometimes newsize is larger than
param_large_function_insns, but smaller than limit, inline doesn't return
failure even if the new function is a large function.
Therefore, param_large_function_insns and param_large_function_growth should be
OR instead of AND, otherwise --param large-function-growth won't
work correctly with --param large-function-insns.
gcc/ChangeLog:
2020-01-07 Luo Xiong Hu <luoxhu@linux.ibm.com>
* ipa-inline-analysis.c (estimate_growth): Fix typo.
* ipa-inline.c (caller_growth_limits): Use OR instead of AND.
From-SVN: r279942
Diff:
---
gcc/ChangeLog | 5 +++++
gcc/ipa-inline-analysis.c | 2 +-
gcc/ipa-inline.c | 4 ++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 513e14a..c7d2530 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-07 Luo Xiong Hu <luoxhu@linux.ibm.com>
+
+ * ipa-inline-analysis.c (estimate_growth): Fix typo.
+ * ipa-inline.c (caller_growth_limits): Use OR instead of AND.
+
2020-01-06 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000.c (hard_reg_and_mode_to_addr_mask): New
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index eb42cae..8b400ff 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -462,7 +462,7 @@ offline_size (struct cgraph_node *node, ipa_size_summary *info)
return 0;
}
-/* Estimate the growth caused by inlining NODE into all callees. */
+/* Estimate the growth caused by inlining NODE into all callers. */
int
estimate_growth (struct cgraph_node *node)
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 3b68fc4..302badf 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -184,8 +184,8 @@ caller_growth_limits (struct cgraph_edge *e)
the function to shrink if it went over the limits by forced inlining. */
newsize = estimate_size_after_inlining (to, e);
if (newsize >= ipa_size_summaries->get (what)->size
- && newsize > opt_for_fn (to->decl, param_large_function_insns)
- && newsize > limit)
+ && (newsize > opt_for_fn (to->decl, param_large_function_insns)
+ || newsize > limit))
{
e->inline_failed = CIF_LARGE_FUNCTION_GROWTH_LIMIT;
return false;
More information about the Gcc-cvs
mailing list