[PATCH] rs6000: ICE when using an MMA type as a function param

Segher Boessenkool segher@kernel.crashing.org
Wed Aug 12 02:00:29 GMT 2020


Hi!

Not just params, but return values as well.  "Error on MMA types in
function prototype"?

On Sun, Aug 09, 2020 at 10:03:35PM -0500, Peter Bergner wrote:
> --- a/gcc/config/rs6000/rs6000-call.c
> +++ b/gcc/config/rs6000/rs6000-call.c
> @@ -6444,8 +6444,23 @@ machine_mode
>  rs6000_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
>  			      machine_mode mode,
>  			      int *punsignedp ATTRIBUTE_UNUSED,
> -			      const_tree, int)
> +			      const_tree, int for_return)
>  {
> +  static struct function *fn = NULL;
> +
> +  /* We do not allow MMA types being used as return values.  Only report
> +     the invalid return value usage the first time we encounter it.  */
> +  if (for_return
> +      && fn != cfun
> +      && (mode == POImode || mode == PXImode))

"fn" is always zero here.

> +    {
> +      fn = cfun;

And what you set here is unused.

So just remove fn?

> +      if (TYPE_CANONICAL (type) != NULL_TREE)

!= NULL_TREE != false != 0

(sorry sorry)

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr96506.c
> @@ -0,0 +1,61 @@
> +/* PR target/96506 */
> +/* { dg-do compile } */
> +/* { dg-require-effective-target power10_ok } */
> +/* { dg-options "-mdejagnu-cpu=power10 -O2 -w" } */

Do you need -w or could a less heavy hammer work as well?

Okay for trunk (and backports after some simmering) with those things
looked at.  Thanks!


Segher


More information about the Gcc-patches mailing list