aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-11-20 02:47:10 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-11-20 02:47:10 +0100
commitf9487002a446cc5f4c777a77afe7c6eaecfec4d0 (patch)
tree67fbdcdd6803ec41d3748836df422ebc60868bcc /gcc/gimplify.c
parent104320132fba35748d61446776c5577645025025 (diff)
downloadgcc-f9487002a446cc5f4c777a77afe7c6eaecfec4d0.zip
gcc-f9487002a446cc5f4c777a77afe7c6eaecfec4d0.tar.gz
gcc-f9487002a446cc5f4c777a77afe7c6eaecfec4d0.tar.bz2
re PR c++/36631 (attribute always_inline -> sorry, unimplemented: recursive inlining)
PR c++/36631 * gimplify.c (gimplify_call_expr): Defer most of the cannot inline checking until GIMPLE lowering. * gimple-low.c (check_call_args): New function. (lower_stmt) <case GIMPLE_CALL>: Call it. * g++.dg/template/call5.C: New test. From-SVN: r142033
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c46
1 files changed, 4 insertions, 42 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index c2de8fd..2000313 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2352,56 +2352,18 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
else if (POINTER_TYPE_P (TREE_TYPE (CALL_EXPR_FN (*expr_p))))
parms = TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (*expr_p))));
- /* Verify if the type of the argument matches that of the function
- declaration. If we cannot verify this or there is a mismatch,
- mark the call expression so it doesn't get inlined later. */
if (fndecl && DECL_ARGUMENTS (fndecl))
- {
- for (i = 0, p = DECL_ARGUMENTS (fndecl);
- i < nargs;
- i++, p = TREE_CHAIN (p))
- {
- /* We cannot distinguish a varargs function from the case
- of excess parameters, still deferring the inlining decision
- to the callee is possible. */
- if (!p)
- break;
- if (p == error_mark_node
- || CALL_EXPR_ARG (*expr_p, i) == error_mark_node
- || !fold_convertible_p (DECL_ARG_TYPE (p),
- CALL_EXPR_ARG (*expr_p, i)))
- {
- CALL_CANNOT_INLINE_P (*expr_p) = 1;
- break;
- }
- }
- }
+ p = DECL_ARGUMENTS (fndecl);
else if (parms)
- {
- for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
- {
- /* If this is a varargs function defer inlining decision
- to callee. */
- if (!p)
- break;
- if (TREE_VALUE (p) == error_mark_node
- || CALL_EXPR_ARG (*expr_p, i) == error_mark_node
- || TREE_CODE (TREE_VALUE (p)) == VOID_TYPE
- || !fold_convertible_p (TREE_VALUE (p),
- CALL_EXPR_ARG (*expr_p, i)))
- {
- CALL_CANNOT_INLINE_P (*expr_p) = 1;
- break;
- }
- }
- }
+ p = parms;
else
{
if (nargs != 0)
CALL_CANNOT_INLINE_P (*expr_p) = 1;
- i = 0;
p = NULL_TREE;
}
+ for (i = 0; i < nargs && p; i++, p = TREE_CHAIN (p))
+ ;
/* If the last argument is __builtin_va_arg_pack () and it is not
passed as a named argument, decrease the number of CALL_EXPR