aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index bd4b48e8623..6b6d489f6ca 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1860,7 +1860,8 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
call_stmt = dyn_cast <gcall *> (stmt);
if (call_stmt
&& gimple_call_va_arg_pack_p (call_stmt)
- && id->call_stmt)
+ && id->call_stmt
+ && ! gimple_call_va_arg_pack_p (id->call_stmt))
{
/* __builtin_va_arg_pack () should be replaced by
all arguments corresponding to ... in the caller. */
@@ -1940,7 +1941,8 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
&& id->call_stmt
&& (decl = gimple_call_fndecl (stmt))
&& DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_ARG_PACK_LEN)
+ && DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_ARG_PACK_LEN
+ && ! gimple_call_va_arg_pack_p (id->call_stmt))
{
/* __builtin_va_arg_pack_len () should be replaced by
the number of anonymous arguments. */
@@ -4584,7 +4586,7 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
/* Record the function we are about to inline. */
id->src_fn = fn;
id->src_cfun = DECL_STRUCT_FUNCTION (fn);
- id->call_stmt = stmt;
+ id->call_stmt = call_stmt;
/* If the src function contains an IFN_VA_ARG, then so will the dst
function after inlining. Likewise for IFN_GOMP_USE_SIMT. */