aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-05-26 18:23:38 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-05-26 18:23:38 +0000
commitba977e1ad972fdad98e39864d12f1d204935af2f (patch)
tree160cb158346c46e3b94ea89324a4be86274f11d8 /gcc
parent4d492420f6e180fbce3e5616cfc10a322f39630c (diff)
downloadgcc-ba977e1ad972fdad98e39864d12f1d204935af2f.zip
gcc-ba977e1ad972fdad98e39864d12f1d204935af2f.tar.gz
gcc-ba977e1ad972fdad98e39864d12f1d204935af2f.tar.bz2
re PR tree-optimization/36329 (latent problem with tree inlining)
PR tree-optimization/36329 * tree.h (CALL_CANNOT_INLINE_P): Add access check. * tree-gimple.h (CALL_STMT_CANNOT_INLINE_P): New macro. * cgraphbuild.c (initialize_inline_failed): Use the latter macro in lieu of the former. * ipa-inline.c (cgraph_mark_inline): Likewise. (cgraph_decide_inlining_of_small_function): Likewise. (cgraph_decide_inlining): Likewise. (cgraph_decide_inlining_incrementally): Likewise. From-SVN: r135954
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/cgraphbuild.c2
-rw-r--r--gcc/ipa-inline.c12
-rw-r--r--gcc/tree-gimple.h3
-rw-r--r--gcc/tree.h2
5 files changed, 23 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f7c7ba5..831b1a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2008-05-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/36329
+ * tree.h (CALL_CANNOT_INLINE_P): Add access check.
+ * tree-gimple.h (CALL_STMT_CANNOT_INLINE_P): New macro.
+ * cgraphbuild.c (initialize_inline_failed): Use the latter
+ macro in lieu of the former.
+ * ipa-inline.c (cgraph_mark_inline): Likewise.
+ (cgraph_decide_inlining_of_small_function): Likewise.
+ (cgraph_decide_inlining): Likewise.
+ (cgraph_decide_inlining_incrementally): Likewise.
+
2008-05-26 Tristan Gingold <gingold@adacore.com>
Anatoly Sokolov <aesok@post.ru>
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 6706c45..e37ca86 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -97,7 +97,7 @@ initialize_inline_failed (struct cgraph_node *node)
"considered for inlining");
else if (!node->local.inlinable)
e->inline_failed = N_("function not inlinable");
- else if (CALL_CANNOT_INLINE_P (e->call_stmt))
+ else if (CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
e->inline_failed = N_("mismatched arguments");
else
e->inline_failed = N_("function not considered for inlining");
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index c3e58f3..6ac851a 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -296,7 +296,7 @@ cgraph_mark_inline (struct cgraph_edge *edge)
struct cgraph_node *what = edge->callee;
struct cgraph_edge *e, *next;
- gcc_assert (!CALL_CANNOT_INLINE_P (edge->call_stmt));
+ gcc_assert (!CALL_STMT_CANNOT_INLINE_P (edge->call_stmt));
/* Look for all calls, mark them inline and clone recursively
all inlined functions. */
for (e = what->callers; e; e = next)
@@ -967,7 +967,7 @@ cgraph_decide_inlining_of_small_functions (void)
else
{
struct cgraph_node *callee;
- if (CALL_CANNOT_INLINE_P (edge->call_stmt)
+ if (CALL_STMT_CANNOT_INLINE_P (edge->call_stmt)
|| !cgraph_check_inline_limits (edge->caller, edge->callee,
&edge->inline_failed, true))
{
@@ -1093,7 +1093,7 @@ cgraph_decide_inlining (void)
for (e = node->callers; e; e = next)
{
next = e->next_caller;
- if (!e->inline_failed || CALL_CANNOT_INLINE_P (e->call_stmt))
+ if (!e->inline_failed || CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
continue;
if (cgraph_recursive_inlining_p (e->caller, e->callee,
&e->inline_failed))
@@ -1134,7 +1134,7 @@ cgraph_decide_inlining (void)
if (node->callers && !node->callers->next_caller && !node->needed
&& node->local.inlinable && node->callers->inline_failed
- && !CALL_CANNOT_INLINE_P (node->callers->call_stmt)
+ && !CALL_STMT_CANNOT_INLINE_P (node->callers->call_stmt)
&& !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl))
{
if (dump_file)
@@ -1297,7 +1297,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
if (!e->callee->local.disregard_inline_limits
&& (mode != INLINE_ALL || !e->callee->local.inlinable))
continue;
- if (CALL_CANNOT_INLINE_P (e->call_stmt))
+ if (CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
continue;
/* When the edge is already inlined, we just need to recurse into
it in order to fully flatten the leaves. */
@@ -1399,7 +1399,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
if (!cgraph_check_inline_limits (node, e->callee, &e->inline_failed,
false)
- || CALL_CANNOT_INLINE_P (e->call_stmt))
+ || CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
{
if (dump_file)
{
diff --git a/gcc/tree-gimple.h b/gcc/tree-gimple.h
index 2c4aa2d..3864d5d 100644
--- a/gcc/tree-gimple.h
+++ b/gcc/tree-gimple.h
@@ -96,6 +96,9 @@ extern bool is_gimple_non_addressable (tree t);
extern bool is_gimple_call_addr (tree);
/* If T makes a function call, returns the CALL_EXPR operand. */
extern tree get_call_expr_in (tree t);
+/* Returns true iff T contains a CALL_EXPR not suitable for inlining. */
+#define CALL_STMT_CANNOT_INLINE_P(T) \
+ CALL_CANNOT_INLINE_P (get_call_expr_in (T))
extern void recalculate_side_effects (tree);
diff --git a/gcc/tree.h b/gcc/tree.h
index 6ac75e6..014f9e9 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1249,7 +1249,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
(CASE_LABEL_EXPR_CHECK (NODE)->base.static_flag)
/* Used to mark a CALL_EXPR as not suitable for inlining. */
-#define CALL_CANNOT_INLINE_P(NODE) ((NODE)->base.static_flag)
+#define CALL_CANNOT_INLINE_P(NODE) (CALL_EXPR_CHECK (NODE)->base.static_flag)
/* In an expr node (usually a conversion) this means the node was made
implicitly and should not lead to any sort of warning. In a decl node,