aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-07-25 10:40:10 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-07-25 10:40:10 +0000
commit264b47b0b934849c588e8754ce72cbb87f77fae7 (patch)
tree6613cc1d23e08527945cf14cd3e12c6d65d03b93 /gcc
parent3d02ae6520c3c20a8379d705db12bf21c7976ab3 (diff)
downloadgcc-264b47b0b934849c588e8754ce72cbb87f77fae7.zip
gcc-264b47b0b934849c588e8754ce72cbb87f77fae7.tar.gz
gcc-264b47b0b934849c588e8754ce72cbb87f77fae7.tar.bz2
ipa-inline.c (can_inline_edge_p): Look into DECL_STRUCT_FUNCTION of original nodes if...
* ipa-inline.c (can_inline_edge_p): Look into DECL_STRUCT_FUNCTION of original nodes if we are dealing with virtual clones. From-SVN: r176739
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-inline.c23
2 files changed, 20 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 66ec2c9..e8a7f25 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ipa-inline.c (can_inline_edge_p): Look into DECL_STRUCT_FUNCTION of
+ original nodes if we are dealing with virtual clones.
+
2011-07-25 Bernd Schmidt <bernds@codesourcery.com>
* common/config/c6x/c6x-common.c: New file.
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index e0cb632..366fc22 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -238,9 +238,20 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
{
bool inlinable = true;
enum availability avail;
- struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, &avail);
+ struct cgraph_node *callee
+ = cgraph_function_or_thunk_node (e->callee, &avail);
tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (e->caller->decl);
- tree callee_tree = callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->decl) : NULL;
+ tree callee_tree
+ = callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->decl) : NULL;
+ struct function *caller_cfun = DECL_STRUCT_FUNCTION (e->caller->decl);
+ struct function *callee_cfun
+ = callee ? DECL_STRUCT_FUNCTION (callee->decl) : NULL;
+
+ if (!caller_cfun && e->caller->clone_of)
+ caller_cfun = DECL_STRUCT_FUNCTION (e->caller->clone_of->decl);
+
+ if (!callee_cfun && callee && callee->clone_of)
+ callee_cfun = DECL_STRUCT_FUNCTION (callee->clone_of->decl);
gcc_assert (e->inline_failed);
@@ -277,12 +288,8 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
caller cannot.
FIXME: this is obviously wrong for LTO where STRUCT_FUNCTION is missing.
Move the flag into cgraph node or mirror it in the inline summary. */
- else if (DECL_STRUCT_FUNCTION (callee->decl)
- && DECL_STRUCT_FUNCTION
- (callee->decl)->can_throw_non_call_exceptions
- && !(DECL_STRUCT_FUNCTION (e->caller->decl)
- && DECL_STRUCT_FUNCTION
- (e->caller->decl)->can_throw_non_call_exceptions))
+ else if (callee_cfun && callee_cfun->can_throw_non_call_exceptions
+ && !(caller_cfun && caller_cfun->can_throw_non_call_exceptions))
{
e->inline_failed = CIF_NON_CALL_EXCEPTIONS;
inlinable = false;