aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2008-12-09 09:14:28 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2008-12-09 10:14:28 +0100
commit457691343552e43ffbce002ef2bd4065e09d7c39 (patch)
tree22389f9764187766baa819ce9d1fcc32e25e5dc3 /gcc
parentf2dc2f86ae47e722651f005b31ca435e3f1f231f (diff)
downloadgcc-457691343552e43ffbce002ef2bd4065e09d7c39.zip
gcc-457691343552e43ffbce002ef2bd4065e09d7c39.tar.gz
gcc-457691343552e43ffbce002ef2bd4065e09d7c39.tar.bz2
function.c (aggregate_value_p): Get fntype from CALL_EXPR in any case.
2008-12-09 Kai Tietz <kai.tietz@onevision.com> PR/38366 * function.c (aggregate_value_p): Get fntype from CALL_EXPR in any case. * calls.c (nitialize_argument_information): Add fntype argument and use it for calls.promote_function_args. (expand_call): Pass fntype to aggregate_value_p if no fndecl available and pass additional fntype to initialize_argument_information. * config/i386/i386.c (ix86_reg_parm_stack_space): Remove cfun part to get function abi type. (init_cumulative_args): Use for abi kind detection fntype, when no fndecl is available. From-SVN: r142584
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/calls.c12
-rw-r--r--gcc/config/i386/i386.c15
-rw-r--r--gcc/function.c4
4 files changed, 32 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b1a6993..db5ed5b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2008-12-09 Kai Tietz <kai.tietz@onevision.com>
+
+ PR/38366
+ * function.c (aggregate_value_p): Get fntype from CALL_EXPR in any
+ case.
+ * calls.c (nitialize_argument_information): Add fntype argument
+ and use it for calls.promote_function_args.
+ (expand_call): Pass fntype to aggregate_value_p if no fndecl
+ available and pass additional fntype to
+ initialize_argument_information.
+ * config/i386/i386.c (ix86_reg_parm_stack_space): Remove cfun part
+ to get function abi type.
+ (init_cumulative_args): Use for abi kind detection fntype, when no
+ fndecl is available.
+
2008-12-09 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.md (movti, movdi_64, movdi_31,
diff --git a/gcc/calls.c b/gcc/calls.c
index e2c4fcb..03994d4 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -136,7 +136,7 @@ static int compute_argument_block_size (int, struct args_size *, tree, tree, int
static void initialize_argument_information (int, struct arg_data *,
struct args_size *, int,
tree, tree,
- tree, CUMULATIVE_ARGS *, int,
+ tree, tree, CUMULATIVE_ARGS *, int,
rtx *, int *, int *, int *,
bool *, bool);
static void compute_argument_addresses (struct arg_data *, rtx, int);
@@ -938,7 +938,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
struct args_size *args_size,
int n_named_args ATTRIBUTE_UNUSED,
tree exp, tree struct_value_addr_value,
- tree fndecl,
+ tree fndecl, tree fntype,
CUMULATIVE_ARGS *args_so_far,
int reg_parm_stack_space,
rtx *old_stack_level, int *old_pending_adj,
@@ -1119,7 +1119,9 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
mode = TYPE_MODE (type);
unsignedp = TYPE_UNSIGNED (type);
- if (targetm.calls.promote_function_args (fndecl ? TREE_TYPE (fndecl) : 0))
+ if (targetm.calls.promote_function_args (fndecl
+ ? TREE_TYPE (fndecl)
+ : fntype))
mode = promote_mode (type, mode, &unsignedp, 1);
args[i].unsignedp = unsignedp;
@@ -2088,7 +2090,7 @@ expand_call (tree exp, rtx target, int ignore)
/* Set up a place to return a structure. */
/* Cater to broken compilers. */
- if (aggregate_value_p (exp, fndecl))
+ if (aggregate_value_p (exp, (!fndecl ? fntype : fndecl)))
{
/* This call returns a big structure. */
flags &= ~(ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE);
@@ -2245,7 +2247,7 @@ expand_call (tree exp, rtx target, int ignore)
arguments into ARGS_SIZE, etc. */
initialize_argument_information (num_actuals, args, &args_size,
n_named_args, exp,
- structure_value_addr_value, fndecl,
+ structure_value_addr_value, fndecl, fntype,
&args_so_far, reg_parm_stack_space,
&old_stack_level, &old_pending_adj,
&must_preallocate, &flags,
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 71fbeac..12e9e5a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4549,16 +4549,12 @@ ix86_must_pass_in_stack (enum machine_mode mode, const_tree type)
int
ix86_reg_parm_stack_space (const_tree fndecl)
{
- int call_abi = 0;
- /* For libcalls it is possible that there is no fndecl at hand.
- Therefore assume for this case the default abi of the target. */
- if (!fndecl)
- call_abi = (cfun ? cfun->machine->call_abi : DEFAULT_ABI);
- else if (TREE_CODE (fndecl) == FUNCTION_DECL)
+ int call_abi = SYSV_ABI;
+ if (fndecl != NULL_TREE && TREE_CODE (fndecl) == FUNCTION_DECL)
call_abi = ix86_function_abi (fndecl);
else
call_abi = ix86_function_type_abi (fndecl);
- if (call_abi == 1)
+ if (call_abi == MS_ABI)
return 32;
return 0;
}
@@ -4647,7 +4643,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
struct cgraph_local_info *i = fndecl ? cgraph_local_info (fndecl) : NULL;
memset (cum, 0, sizeof (*cum));
- cum->call_abi = ix86_function_type_abi (fntype);
+ if (fndecl)
+ cum->call_abi = ix86_function_abi (fndecl);
+ else
+ cum->call_abi = ix86_function_type_abi (fntype);
/* Set up the number of registers to use for passing arguments. */
cum->nregs = ix86_regparm;
if (TARGET_64BIT)
diff --git a/gcc/function.c b/gcc/function.c
index 2ed1748..29fe1b0 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1766,7 +1766,9 @@ aggregate_value_p (const_tree exp, const_tree fntype)
{
case CALL_EXPR:
fndecl = get_callee_fndecl (fntype);
- fntype = fndecl ? TREE_TYPE (fndecl) : 0;
+ fntype = (fndecl
+ ? TREE_TYPE (fndecl)
+ : TREE_TYPE (CALL_EXPR_FN (fntype)));
break;
case FUNCTION_DECL:
fndecl = fntype;