[Bug target/108348] ICE in gen_movoo, at config/rs6000/mma.md:292

bergner at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 10 17:08:42 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108348

--- Comment #5 from Peter Bergner <bergner at gcc dot gnu.org> ---
(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) == OOmode || TYPE_MODE (arg.type) == 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/return
type, it must be via a pointer to that type, so pass-by-referernce.


More information about the Gcc-bugs mailing list