aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-low.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-04-10 13:20:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-04-10 13:20:50 +0000
commite30459d52bc7d6c280006cae64eef63612a064be (patch)
tree14de5cda4459eb380afbab27f59e8c6459a681d1 /gcc/gimple-low.c
parent0878843fd50d1ac01305b963a5b4c52732694f01 (diff)
downloadgcc-e30459d52bc7d6c280006cae64eef63612a064be.zip
gcc-e30459d52bc7d6c280006cae64eef63612a064be.tar.gz
gcc-e30459d52bc7d6c280006cae64eef63612a064be.tar.bz2
re PR middle-end/52888 (Unable to inline function pointer call with inexact signature match)
2012-04-10 Richard Guenther <rguenther@suse.de> PR middle-end/52888 * gimple-low.c (gimple_check_call_args): Properly account for compatible aggregate types. From-SVN: r186276
Diffstat (limited to 'gcc/gimple-low.c')
-rw-r--r--gcc/gimple-low.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index f6deba1..4a1ae0b 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -240,15 +240,17 @@ gimple_check_call_args (gimple stmt, tree fndecl)
i < nargs;
i++, p = DECL_CHAIN (p))
{
+ tree arg;
/* 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;
+ arg = gimple_call_arg (stmt, i);
if (p == error_mark_node
- || gimple_call_arg (stmt, i) == error_mark_node
- || !fold_convertible_p (DECL_ARG_TYPE (p),
- gimple_call_arg (stmt, i)))
+ || arg == error_mark_node
+ || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg))
+ && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
return false;
}
}
@@ -256,15 +258,17 @@ gimple_check_call_args (gimple stmt, tree fndecl)
{
for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
{
+ tree arg;
/* If this is a varargs function defer inlining decision
to callee. */
if (!p)
break;
+ arg = gimple_call_arg (stmt, i);
if (TREE_VALUE (p) == error_mark_node
- || gimple_call_arg (stmt, i) == error_mark_node
+ || arg == error_mark_node
|| TREE_CODE (TREE_VALUE (p)) == VOID_TYPE
- || !fold_convertible_p (TREE_VALUE (p),
- gimple_call_arg (stmt, i)))
+ || (!types_compatible_p (TREE_VALUE (p), TREE_TYPE (arg))
+ && !fold_convertible_p (TREE_VALUE (p), arg)))
return false;
}
}