https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103353
--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #5)
> (In reply to Segher Boessenkool from comment #4)
> > You miss all extra errors the expand_call can generate. This is the general
> > reason why we try to continue instead of stopping after the first error.
> > The
> > reason is that later errors may be more obvious to the user. This of course
> > does no longer work so well because our errors now take 30 lines instead of
> > 1.
>
> Thanks for the explanation! One consequent question is that this point can
> be applied for the other places where some expected conditions don't hold
> for bif expansion, but I saw the other places are using "return const0_rtx".
> Is there something special causing this difference?
Not really, no. In general we try to continue a bit longer (like, evaluate
the arguments, as here). This gives much better diagnostics to the user. In
a few cases you just have to give up early though, for practical reasons.
> > It probably is best if the generic opaque-mode emit_move code does not try
> > to move it via some other mode_class. Peter?
> >
> > Failing that, we can work around it by having move patterns for those modes
> > always, but hard erroring on them (FAIL is no good).
>
> Yeah, one workround can help the ICE gone: (similar thing needed for XOmode
> as well):
>
> diff --git a/gcc/config/rs6000/mma.md b/gcc/config/rs6000/mma.md
> index 907c9d6d516..04e887ad147 100644
> --- a/gcc/config/rs6000/mma.md
> +++ b/gcc/config/rs6000/mma.md
> @@ -268,10 +268,12 @@ (define_int_attr avvi4i4i4 [(UNSPEC_MMA_PMXVI8GER4PP
> "pmxvi8ger4pp")
> (define_expand "movoo"
> [(set (match_operand:OO 0 "nonimmediate_operand")
> (match_operand:OO 1 "input_operand"))]
> - "TARGET_MMA"
> + ""
> {
> - rs6000_emit_move (operands[0], operands[1], OOmode);
> - DONE;
> + if (TARGET_MMA) {
> + rs6000_emit_move (operands[0], operands[1], OOmode);
> + DONE;
> + }
> })
Like that. But with a big fat comment, what is done when !TARGET_MMA, and
why we do that. It is arguably the completely wrong thing to do for opaque
modes.