From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1579) id 2636B38582AD; Mon, 17 Oct 2022 19:45:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2636B38582AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666035939; bh=dHQW5croZijkq32eK5SWUx6P4HNoNI1YFCDGldBZHQw=; h=From:To:Subject:Date:From; b=VAiQi1uOAGcddePlGcPZKsZb0QSEPFPMnjrTL2whvXoml0fFSfogxiH6lUyKdt9DY meXqHbX6Tdtz5fSAMU6ZPUdFS1Y77KBBz3JhRFpSE+CGTqRTBR7CB5hoOpdr69RMup FvupFNoIjyUb6EdeMKfxemjqmenpLhrOP9fra+Cg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pat Haugen To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-8842] Fix register count when not splitting Complex IEEE 128-bit args. X-Act-Checkin: gcc X-Git-Author: Pat Haugen X-Git-Refname: refs/heads/releases/gcc-12 X-Git-Oldrev: fe7d74313736b8e1c30812bc49419f419bdf1c53 X-Git-Newrev: 0bc43f9ae1384787b0efcf9a41f00c1eeaf8bb8b Message-Id: <20221017194539.2636B38582AD@sourceware.org> Date: Mon, 17 Oct 2022 19:45:39 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0bc43f9ae1384787b0efcf9a41f00c1eeaf8bb8b commit r12-8842-g0bc43f9ae1384787b0efcf9a41f00c1eeaf8bb8b Author: Pat Haugen Date: Tue May 17 15:53:24 2022 -0500 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) Diff: --- gcc/config/rs6000/rs6000-call.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/config/rs6000/rs6000-call.cc b/gcc/config/rs6000/rs6000-call.cc index f06c69252b2..d27df7b25ac 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"