diff options
author | Chung-Lin Tang <cltang@codesourcery.com> | 2018-08-20 18:32:06 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-08-20 12:32:06 -0600 |
commit | 846d943b4592561743d86ae90a9320b3ea03378c (patch) | |
tree | 5c2e5e1ca920dbcdf5e9ae0a669d9bb8fc9d832a /gcc/targhooks.c | |
parent | a5a35247177708c5dd2e6c835ae5aa19fe1fb77e (diff) | |
download | gcc-846d943b4592561743d86ae90a9320b3ea03378c.zip gcc-846d943b4592561743d86ae90a9320b3ea03378c.tar.gz gcc-846d943b4592561743d86ae90a9320b3ea03378c.tar.bz2 |
targhooks.c (std_gimplify_va_arg_expr): Properly handle case of when TARGET_SPLIT_COMPLEX_ARG is defined.
* targhooks.c (std_gimplify_va_arg_expr): Properly handle case of when
TARGET_SPLIT_COMPLEX_ARG is defined.
From-SVN: r263671
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 32b4993..afd56f3 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -2154,6 +2154,23 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, if (indirect) type = build_pointer_type (type); + if (targetm.calls.split_complex_arg + && TREE_CODE (type) == COMPLEX_TYPE + && targetm.calls.split_complex_arg (type)) + { + tree real_part, imag_part; + + real_part = std_gimplify_va_arg_expr (valist, + TREE_TYPE (type), pre_p, NULL); + real_part = get_initialized_tmp_var (real_part, pre_p, NULL); + + imag_part = std_gimplify_va_arg_expr (unshare_expr (valist), + TREE_TYPE (type), pre_p, NULL); + imag_part = get_initialized_tmp_var (imag_part, pre_p, NULL); + + return build2 (COMPLEX_EXPR, type, real_part, imag_part); + } + align = PARM_BOUNDARY / BITS_PER_UNIT; boundary = targetm.calls.function_arg_boundary (TYPE_MODE (type), type); |