From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B06073858CDA; Tue, 10 Jan 2023 17:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B06073858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673370522; bh=p1fLsN/KmsKwodSwq1VKWN30nrjSMKFzj7AgF6CzS4k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YdNST1LAvPDqMH2ULfYEyZmJ3jUaUiLjGuXXzTq/MobTDkhtzg04a9qowilIFoyS+ gG7UqewcHpfe1Uup3qOmuoWAI9osSVWEnZgQY+mqdgoHxMNG9sNdsR7yofFkwQoe1N H2UlezRQzQkr6wsarxtnpahDMWVfZjTH58Qqcpi0= From: "bergner at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108348] ICE in gen_movoo, at config/rs6000/mma.md:292 Date: Tue, 10 Jan 2023 17:08:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: bergner at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108348 --- Comment #5 from Peter Bergner --- (In reply to Kewen Lin from comment #1) > diff --git a/gcc/config/rs6000/rs6000-call.cc > b/gcc/config/rs6000/rs6000-call.cc > index 59c51fa3579..6767a1f541c 100644 > --- a/gcc/config/rs6000/rs6000-call.cc > +++ b/gcc/config/rs6000/rs6000-call.cc > @@ -2013,6 +2013,11 @@ rs6000_pass_by_reference (cumulative_args_t, const > function_arg_info &arg) > { > if (TARGET_DEBUG_ARG) > fprintf (stderr, "function_arg_pass_by_reference: AltiVec\n"); > + /* We do not allow MMA types being used as function arguments, > + return false to avoid the ICE on the copying for passing by > + reference. */ > + if (TYPE_MODE (arg.type) =3D=3D OOmode || TYPE_MODE (arg.type) =3D= =3D XOmode) > + return 0; > return 1; > } This doesn't seem right. The function comment for rs6000_pass_by_reference= is: A C expression that indicates when an argument must be passed by reference. If nonzero for an argument, a copy of that argument is made in memory and a pointer to the argument is passed instead of the argument itself. The pointer is passed in whatever way is appropriate for passing a pointer to that type. By returning false here, that seems to imply that MMA types don't have to be passed by reference. Does that imply they can be passed by value? If so, that's not correct, since if we have a MMA type as a function argument/retu= rn type, it must be via a pointer to that type, so pass-by-referernce.=