aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog20
-rw-r--r--gcc/c-objc-common.c14
-rw-r--r--gcc/c-objc-common.h3
-rw-r--r--gcc/cgraphunit.c4
-rw-r--r--gcc/ipa-inline.c2
-rw-r--r--gcc/langhooks-def.h4
-rw-r--r--gcc/langhooks.c13
-rw-r--r--gcc/langhooks.h1
-rw-r--r--gcc/tree-inline.c9
-rw-r--r--gcc/tree-inline.h1
10 files changed, 33 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aa6c008..4ce1dd6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,25 @@
2007-08-20 Richard Guenther <rguenther@suse.de>
+ * c-objc-common.c (c_disregard_inline_limits): Remove.
+ * c-objc-common.h (c_disregard_inline_limits): Likewise.
+ * cgraphunit.c (cgraph_process_new_functions): Call
+ disregard_inline_limits_p.
+ (cgraph_preserve_function_body_p): Likewise.
+ * ipa-inline.c (compute_inline_parameters): Likewise.
+ * langhooks-def.h (lhd_tree_inlining_disregard_inline_limits):
+ Remove.
+ (LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS): Remove.
+ (LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
+ disregard_inline_limits langhook.
+ * langhooks.c (lhd_tree_inlining_disregard_inline_limits):
+ Remove.
+ * langhooks.h (lang_hooks_for_tree_inlining): Remove
+ disregard_inline_limits langhook.
+ * tree-inline.c (disregard_inline_limits_p): New function.
+ * tree-inline.h (disregard_inline_limits_p): Declare.
+
+2007-08-20 Richard Guenther <rguenther@suse.de>
+
* langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove.
(LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): Likewise.
(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 58c748c..efd576f 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -50,20 +50,6 @@ c_missing_noreturn_ok_p (tree decl)
return flag_hosted && MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl));
}
-/* We want to inline `extern inline' functions even if this would
- violate inlining limits. Some glibc and linux constructs depend on
- such functions always being inlined when optimizing. */
-
-int
-c_disregard_inline_limits (const_tree fn)
-{
- if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
- return 1;
-
- return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
- && DECL_EXTERNAL (fn));
-}
-
int
c_cannot_inline_tree_fn (tree *fnp)
{
diff --git a/gcc/c-objc-common.h b/gcc/c-objc-common.h
index b8355d2..66b25b3 100644
--- a/gcc/c-objc-common.h
+++ b/gcc/c-objc-common.h
@@ -85,9 +85,6 @@ extern void c_initialize_diagnostics (diagnostic_context *);
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
c_cannot_inline_tree_fn
-#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS
-#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
- c_disregard_inline_limits
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index f810c27..dddc093 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -381,7 +381,7 @@ cgraph_process_new_functions (void)
node->local.self_insns = estimate_num_insns (fndecl,
&eni_inlining_weights);
node->local.disregard_inline_limits
- |= lang_hooks.tree_inlining.disregard_inline_limits (fndecl);
+ |= disregard_inline_limits_p (fndecl);
/* Inlining characteristics are maintained by the
cgraph_mark_inline. */
node->global.insns = node->local.self_insns;
@@ -1252,7 +1252,7 @@ cgraph_preserve_function_body_p (tree decl)
struct cgraph_node *node;
if (!cgraph_global_info_ready)
return (flag_really_no_inline
- ? lang_hooks.tree_inlining.disregard_inline_limits (decl)
+ ? disregard_inline_limits_p (decl)
: DECL_INLINE (decl));
/* Look if there is any clone around. */
for (node = cgraph_node (decl); node; node = node->next_clone)
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 21b894f..f74ebf8 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1529,7 +1529,7 @@ compute_inline_parameters (void)
&eni_inlining_weights);
if (node->local.inlinable && !node->local.disregard_inline_limits)
node->local.disregard_inline_limits
- = lang_hooks.tree_inlining.disregard_inline_limits (current_function_decl);
+ = disregard_inline_limits_p (current_function_decl);
if (flag_really_no_inline && !node->local.disregard_inline_limits)
node->local.inlinable = 0;
/* Inlining characteristics are maintained by the cgraph_mark_inline. */
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 862ea18..05d8f4b7 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -69,7 +69,6 @@ extern tree lhd_builtin_function (tree decl);
/* Declarations of default tree inlining hooks. */
extern int lhd_tree_inlining_cannot_inline_tree_fn (tree *);
-extern int lhd_tree_inlining_disregard_inline_limits (const_tree);
extern void lhd_initialize_diagnostics (struct diagnostic_context *);
extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
@@ -134,14 +133,11 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
/* Tree inlining hooks. */
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
lhd_tree_inlining_cannot_inline_tree_fn
-#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
- lhd_tree_inlining_disregard_inline_limits
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \
hook_bool_tree_tree_false
#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \
- LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \
LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, \
}
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 2a731b7..56680c9 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -290,19 +290,6 @@ lhd_tree_inlining_cannot_inline_tree_fn (tree *fnp)
return 0;
}
-/* lang_hooks.tree_inlining.disregard_inline_limits is called to
- determine whether a function should be considered for inlining even
- if it would exceed inlining limits. */
-
-int
-lhd_tree_inlining_disregard_inline_limits (const_tree fn)
-{
- if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
- return 1;
-
- return 0;
-}
-
/* lang_hooks.tree_dump.dump_tree: Dump language-specific parts of tree
nodes. Returns nonzero if it does not want the usual dumping of the
second argument. */
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 0032e555..a25371c 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -36,7 +36,6 @@ typedef void (*lang_print_tree_hook) (FILE *, tree, int indent);
struct lang_hooks_for_tree_inlining
{
int (*cannot_inline_tree_fn) (tree *);
- int (*disregard_inline_limits) (const_tree);
bool (*var_mod_type_p) (tree, tree);
};
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 80a1883..1619838 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1914,6 +1914,15 @@ inlinable_function_p (tree fn)
return inlinable;
}
+/* Return true if we shall disregard inlining limits for the function
+ FN during inlining. */
+
+bool
+disregard_inline_limits_p (tree fn)
+{
+ return lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL_TREE;
+}
+
/* Estimate the cost of a memory move. Use machine dependent
word size and take possible memcpy call into account. */
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index 200a9a6..05d921a 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -130,6 +130,7 @@ extern void insert_decl_map (copy_body_data *, tree, tree);
unsigned int optimize_inline_calls (tree);
bool tree_inlinable_function_p (tree);
+bool disregard_inline_limits_p (tree);
tree copy_tree_r (tree *, int *, void *);
void clone_body (tree, tree, void *);
void save_body (tree, tree *, tree *);