Hi!

On Wed, Feb 16, 2022 at 08:11:17PM +0100, Robin Dapp wrote:
> since r12-6747-gaa8cfe785953a0 ifcvt not only passes real comparisons
> but also "cc comparisons" (i.e. the representation of the result of a
> comparison) to the backend.  rs6000_emit_int_cmove () is not prepared to
> handle this.  Therefore, this patch makes it return false in such a case
> in order to avoid an ICE.

> On P10 I compared the testsuite of the last commit before the breaking
> one (r12-6746-ge9ebb86799fd77, but commenting out a line that would
> still result in a "-Wformat-diag" bootstrap error then)

I have used --disable-werror for weeks already :-(

>       PR target/104335
> 
> gcc/ChangeLog:
> 
>       * config/rs6000/rs6000.cc (rs6000_emit_int_cmove): Return false
>       if the expected comparison's first operand is of mode MODE_CC.

Please send patches as plain text, not as base64.

> --- a/gcc/config/rs6000/rs6000.cc
> +++ b/gcc/config/rs6000/rs6000.cc
> @@ -16175,6 +16175,12 @@ rs6000_emit_int_cmove (rtx dest, rtx op, rtx 
> true_cond, rtx false_cond)
>    if (mode != SImode && (!TARGET_POWERPC64 || mode != DImode))
>      return false;
>  
> +  /* PR104335: We now need to expect CC-mode "comparisons"
> +     coming from ifcvt.  The following code expects proper
> +     comparisons so better abort here.  */
> +  if (XEXP (op, 0) && GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC)
> +    return false;

Why that first test?  XEXP (op, 0) is required to not be nil.

The patch is okay without that (if it passes testing of course :-) )
Thanks!


Segher

Reply via email to