aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPat Haugen <pthaugen@linux.ibm.com>2022-05-17 15:53:24 -0500
committerPat Haugen <pthaugen@linux.ibm.com>2022-10-17 14:44:14 -0500
commit0bc43f9ae1384787b0efcf9a41f00c1eeaf8bb8b (patch)
tree235a01d86365191a041c7d6208aa01a3d2d3b9dc /gcc
parentfe7d74313736b8e1c30812bc49419f419bdf1c53 (diff)
downloadgcc-0bc43f9ae1384787b0efcf9a41f00c1eeaf8bb8b.zip
gcc-0bc43f9ae1384787b0efcf9a41f00c1eeaf8bb8b.tar.gz
gcc-0bc43f9ae1384787b0efcf9a41f00c1eeaf8bb8b.tar.bz2
Fix register count when not splitting Complex IEEE 128-bit args.
For ABI_V4, we do not split complex args. This created a problem because even though an arg would be passed in two VSX regs, we were only advancing the function arg counter by one VSX register. Fixed with this patch. PR target/99685 gcc/ * config/rs6000/rs6000-call.cc (rs6000_function_arg_advance_1): Bump register count when not splitting IEEE 128-bit Complex. (cherry picked from commit 2ee68beee709e48fce85b8892ff9985acc6a91a8)
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/rs6000/rs6000-call.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000-call.cc b/gcc/config/rs6000/rs6000-call.cc
index f06c692..d27df7b 100644
--- a/gcc/config/rs6000/rs6000-call.cc
+++ b/gcc/config/rs6000/rs6000-call.cc
@@ -1111,6 +1111,12 @@ rs6000_function_arg_advance_1 (CUMULATIVE_ARGS *cum, machine_mode mode,
{
cum->vregno += n_elts;
+ /* If we are not splitting Complex IEEE128 args then account for the
+ fact that they are passed in 2 VSX regs. */
+ if (!targetm.calls.split_complex_arg && type
+ && TREE_CODE (type) == COMPLEX_TYPE && elt_mode == KCmode)
+ cum->vregno++;
+
if (!TARGET_ALTIVEC)
error ("cannot pass argument in vector register because"
" altivec instructions are disabled, use %qs"