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

--- Comment #6 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #5)
> (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.

Thanks @Peter for the comments! I think you are right. By checking the
handlings after pass-by-reference is true, I found the argument (tree_value)
would be replaced with one pointer to that type, which is permitted. I'll go
back to the approach teaching the invalid use of MMA type argument (without MMA
support) in rs6000_opaque_type_invalid_use_p then.

Reply via email to