summaryrefslogtreecommitdiffstats
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authornemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-29 00:08:07 +0000
committernemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-03-29 00:08:07 +0000
commit69428266fb156da2ba81f084fdd770bdbbc57234 (patch)
tree27ae0d6521d000b4e4f8f144d612fdc7b84ad348 /gcc/cgraph.c
parentd093f898a46b0ff8221b31c1149d85180fc654f8 (diff)
downloadppe42-gcc-69428266fb156da2ba81f084fdd770bdbbc57234.tar.gz
ppe42-gcc-69428266fb156da2ba81f084fdd770bdbbc57234.zip
* cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges): Don't
call initialize_inline_failed. (initialize_inline_failed): Move it from here ... * cgraph.c (initialize_inline_failed): ... to here. (cgraph_create_edge): Call initialize_inline_failed rather than setting inline_failed directly. testsuite/ * gcc.dg/winline-10.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145215 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 8eb0381d2be..d5dba426b1a 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -652,6 +652,26 @@ cgraph_set_call_stmt (struct cgraph_edge *e, gimple new_stmt)
}
}
+/* Give initial reasons why inlining would fail on EDGE. This gets either
+ nullified or usually overwritten by more precise reasons later. */
+
+static void
+initialize_inline_failed (struct cgraph_edge *e)
+{
+ struct cgraph_node *callee = e->callee;
+
+ if (!callee->analyzed)
+ e->inline_failed = CIF_BODY_NOT_AVAILABLE;
+ else if (callee->local.redefined_extern_inline)
+ e->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
+ else if (!callee->local.inlinable)
+ e->inline_failed = CIF_FUNCTION_NOT_INLINABLE;
+ else if (gimple_call_cannot_inline_p (e->call_stmt))
+ e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
+ else
+ e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
+}
+
/* Create edge from CALLER to CALLEE in the cgraph. */
struct cgraph_edge *
@@ -679,15 +699,6 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
edge->uid = cgraph_edge_max_uid++;
}
- if (!callee->analyzed)
- edge->inline_failed = CIF_BODY_NOT_AVAILABLE;
- else if (callee->local.redefined_extern_inline)
- edge->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
- else if (callee->local.inlinable)
- edge->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
- else
- edge->inline_failed = CIF_FUNCTION_NOT_INLINABLE;
-
edge->aux = NULL;
edge->caller = caller;
@@ -721,6 +732,9 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
gcc_assert (!*slot);
*slot = edge;
}
+
+ initialize_inline_failed (edge);
+
return edge;
}
OpenPOWER on IntegriCloud