[RFA] Patch to allow SPU port to build with current trunk

Ulrich Weigand uweigand@de.ibm.com
Wed Oct 26 07:34:00 GMT 2016

Jeff Law wrote:

> First, there's a missing fallthru comment in spu_sched_reorder for 
> TYPE_LOAD/TYPE_STORE cases.  If I'm reading the SPU docs properly a 
> load/store insn is handled by pipe_1 and we're also trying to model some 
> aspects of the load-store unit.  So we should be setting pipe_ls and pipe_1:
>           case TYPE_LOAD:
>            case TYPE_STORE:
>              pipe_ls = i;
>            case TYPE_LNOP:
>            case TYPE_SHUF:
>            case TYPE_BR:
>            case TYPE_MULTI1:
>            case TYPE_HBR:
>              pipe_1 = i;
>              break;
> This looks like intentional fallthru and should just have an appropriate 
> comment to silence the warning.


> spu_legitimate_address looks far more interesting and I think it's buggy 
> as written:
>      case SUBREG:
>        x = XEXP (x, 0);
>        if (REG_P (x))
>          return 0;
>      case REG:
>        return INT_REG_OK_FOR_BASE_P (x, reg_ok_strict);
> I think the test is inverted.  We want to consider (subreg (reg)) a 
> valid memory address and reject all other (subreg (...)) expressions. 
> But this code does the opposite.

Oops, it looks like this has been broken since this commit:

>	* config/spu/spu.c (spu_sched_reorder): Add missing fallthru comment.
>	(spu_legitimate_address_p): Fix logic error and add missing fallthru
>	comment.

This is OK.


  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain

More information about the Gcc-patches mailing list