diff options
author | Richard Henderson <rth@redhat.com> | 2004-03-12 02:03:32 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-03-12 02:03:32 -0800 |
commit | 42ba51300418d586a41637d9c1fc72c6078b7c6d (patch) | |
tree | bdd3000f3e6489ec11b58de31921ac902908031e /gcc/function.c | |
parent | ac011d28bb63763829fd3bec7792fe13d58cfac7 (diff) | |
download | gcc-42ba51300418d586a41637d9c1fc72c6078b7c6d.zip gcc-42ba51300418d586a41637d9c1fc72c6078b7c6d.tar.gz gcc-42ba51300418d586a41637d9c1fc72c6078b7c6d.tar.bz2 |
re PR target/14547 (Passing _Complex long double does not follow the ABI)
PR target/14547
* target.h (struct gcc_target): Move calls substructure before
booleans. Add split_complex_arg.
* function.c (assign_parms, split_complex_args): Use it.
* calls.c (expand_call): Likewise.
(split_complex_values): Likewise. Check for splittable types
before allocating memory.
(split_complex_types): Likewise.
* system.h (SPLIT_COMPLEX_ARGS): Poison.
* expr.h (SPLIT_COMPLEX_ARGS): Remove.
* target-def.h (TARGET_SPLIT_COMPLEX_ARG): New.
* config/alpha/alpha.c (alpha_split_complex_arg): New.
(TARGET_SPLIT_COMPLEX_ARG): New.
* config/alpha/alpha.h (SPLIT_COMPLEX_ARGS): Remove.
* config/rs6000/rs6000.c (TARGET_SPLIT_COMPLEX_ARG): New.
(rs6000_override_options): Zap it for non-AIX.
(rs6000_function_value): Use targetm.calls.split_complex_arg.
* config/rs6000/rs6000.h (SPLIT_COMPLEX_ARGS): Remove.
* config/xtensa/xtensa.c (TARGET_SPLIT_COMPLEX_ARG): New.
* config/xtensa/xtensa.h (SPLIT_COMPLEX_ARGS): Remove.
* doc/tm.texi (TARGET_SPLIT_COMPLEX_ARG): Modify from old
SPLIT_COMPLEX_ARGS entry.
From-SVN: r79376
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/function.c b/gcc/function.c index 2f68eaa..3d48b40 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4349,7 +4349,8 @@ assign_parms (tree fndecl) max_parm_reg = LAST_VIRTUAL_REGISTER + 1; parm_reg_stack_loc = ggc_alloc_cleared (max_parm_reg * sizeof (rtx)); - if (SPLIT_COMPLEX_ARGS) + /* If the target wants to split complex arguments into scalars, do so. */ + if (targetm.calls.split_complex_arg) fnargs = split_complex_args (fnargs); #ifdef REG_PARM_STACK_SPACE @@ -5225,11 +5226,12 @@ assign_parms (tree fndecl) } } - if (SPLIT_COMPLEX_ARGS && fnargs != orig_fnargs) + if (targetm.calls.split_complex_arg && fnargs != orig_fnargs) { for (parm = orig_fnargs; parm; parm = TREE_CHAIN (parm)) { - if (TREE_CODE (TREE_TYPE (parm)) == COMPLEX_TYPE) + if (TREE_CODE (TREE_TYPE (parm)) == COMPLEX_TYPE + && targetm.calls.split_complex_arg (TREE_TYPE (parm))) { rtx tmp, real, imag; enum machine_mode inner = GET_MODE_INNER (DECL_MODE (parm)); @@ -5373,8 +5375,12 @@ split_complex_args (tree args) /* Before allocating memory, check for the common case of no complex. */ for (p = args; p; p = TREE_CHAIN (p)) - if (TREE_CODE (TREE_TYPE (p)) == COMPLEX_TYPE) - goto found; + { + tree type = TREE_TYPE (p); + if (TREE_CODE (type) == COMPLEX_TYPE + && targetm.calls.split_complex_arg (type)) + goto found; + } return args; found: @@ -5383,7 +5389,8 @@ split_complex_args (tree args) for (p = args; p; p = TREE_CHAIN (p)) { tree type = TREE_TYPE (p); - if (TREE_CODE (type) == COMPLEX_TYPE) + if (TREE_CODE (type) == COMPLEX_TYPE + && targetm.calls.split_complex_arg (type)) { tree decl; tree subtype = TREE_TYPE (type); |