mirror of git://gcc.gnu.org/git/gcc.git
cfgexpand.c (expand_call_stmt): Rematerialize the original function type if this is not a builtin function.
* cfgexpand.c (expand_call_stmt): Rematerialize the original function type if this is not a builtin function. From-SVN: r172459
This commit is contained in:
parent
09db7afe4f
commit
e792558227
|
@ -1,3 +1,8 @@
|
||||||
|
2011-04-14 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
|
* cfgexpand.c (expand_call_stmt): Rematerialize the original function
|
||||||
|
type if this is not a builtin function.
|
||||||
|
|
||||||
2011-04-14 Jakub Jelinek <jakub@redhat.com>
|
2011-04-14 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR target/48605
|
PR target/48605
|
||||||
|
|
|
@ -1837,11 +1837,9 @@ expand_gimple_cond (basic_block bb, gimple stmt)
|
||||||
static void
|
static void
|
||||||
expand_call_stmt (gimple stmt)
|
expand_call_stmt (gimple stmt)
|
||||||
{
|
{
|
||||||
tree exp;
|
tree exp, decl, lhs = gimple_call_lhs (stmt);
|
||||||
tree lhs = gimple_call_lhs (stmt);
|
|
||||||
size_t i;
|
|
||||||
bool builtin_p;
|
bool builtin_p;
|
||||||
tree decl;
|
size_t i;
|
||||||
|
|
||||||
exp = build_vl_exp (CALL_EXPR, gimple_call_num_args (stmt) + 3);
|
exp = build_vl_exp (CALL_EXPR, gimple_call_num_args (stmt) + 3);
|
||||||
|
|
||||||
|
@ -1849,6 +1847,13 @@ expand_call_stmt (gimple stmt)
|
||||||
decl = gimple_call_fndecl (stmt);
|
decl = gimple_call_fndecl (stmt);
|
||||||
builtin_p = decl && DECL_BUILT_IN (decl);
|
builtin_p = decl && DECL_BUILT_IN (decl);
|
||||||
|
|
||||||
|
/* If this is not a builtin function, the function type through which the
|
||||||
|
call is made may be different from the type of the function. */
|
||||||
|
if (!builtin_p)
|
||||||
|
CALL_EXPR_FN (exp)
|
||||||
|
= fold_build1 (NOP_EXPR, build_pointer_type (gimple_call_fntype (stmt)),
|
||||||
|
CALL_EXPR_FN (exp));
|
||||||
|
|
||||||
TREE_TYPE (exp) = gimple_call_return_type (stmt);
|
TREE_TYPE (exp) = gimple_call_return_type (stmt);
|
||||||
CALL_EXPR_STATIC_CHAIN (exp) = gimple_call_chain (stmt);
|
CALL_EXPR_STATIC_CHAIN (exp) = gimple_call_chain (stmt);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue