]> gcc.gnu.org Git - gcc.git/commitdiff
Fix register count when not splitting Complex IEEE 128-bit args.
authorPat Haugen <pthaugen@linux.ibm.com>
Mon, 17 Oct 2022 20:11:42 +0000 (15:11 -0500)
committerPat Haugen <pthaugen@linux.ibm.com>
Mon, 17 Oct 2022 20:14:13 +0000 (15:14 -0500)
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.

(backported commit 2ee68beee709e48fce85b8892ff9985acc6a91a8)

gcc/
PR target/99685
* config/rs6000/rs6000-call.c (rs6000_function_arg_advance_1): Bump
register count when not splitting IEEE 128-bit Complex.

gcc/config/rs6000/rs6000-call.c

index e58b149d022ce41ad88a1c0bb5e01ef062770971..1be4797e834065be969cff4104a430b390384f36 100644 (file)
@@ -7190,6 +7190,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"
This page took 0.068089 seconds and 5 git commands to generate.