diff options
author | Richard Guenther <rguenther@suse.de> | 2007-06-29 13:43:10 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-06-29 13:43:10 +0000 |
commit | 42f6e2ec11f6dabcdc48b9b6a739d05d70a8c9f7 (patch) | |
tree | 34d09710500c8001c0c549f2d207f6cd59a0b876 /gcc/gimplify.c | |
parent | 29fbecf33f017563e0e5488188d23b32a38bcbeb (diff) | |
download | gcc-42f6e2ec11f6dabcdc48b9b6a739d05d70a8c9f7.tar.gz |
re PR middle-end/32493 (Fails to inline varargs function with unused arguments)
2006-06-29 Richard Guenther <rguenther@suse.de>
PR middle-end/32493
* gimplify.c (gimplify_call_expr): Ignore variable argument parts
during type verification.
* gcc.dg/inline-23.c: New testcase.
From-SVN: r126113
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index d935ec17f6e..a7669acc968 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -2138,14 +2138,21 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value) if (parms) { for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p)) - if (!p - || TREE_VALUE (p) == error_mark_node - || CALL_EXPR_ARG (*expr_p, i) == error_mark_node - || !fold_convertible_p (TREE_VALUE (p), CALL_EXPR_ARG (*expr_p, i))) - { - CALL_CANNOT_INLINE_P (*expr_p) = 1; + { + /* 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; + } + } } else if (decl && DECL_ARGUMENTS (decl)) { |