You can ignore that last email.  I think I finally found where the
problem is.  In the main program:

extern void abort (void);
int main ()
{
  signed char a = -1;
  _Sat unsigned _Fract b = a;
  if (b != 0.0ur)
    abort();
  return 0;
}

If I compile with -O0, I see:

        li      $2,-1                   # 0xffffffffffffffff
        sb      $2,24($fp)
        lbu     $4,24($fp)
        jal     __satfractqiuhq

We put -1 in register $2, store the byte, then load the byte as an
unsigned char instead of a signed char.  When TARGET_PROMOTE_PROTOTYPES
was defined it didn't matter because __satfractqiuhq did another sign
extend before using the value.  When I got rid of
TARGET_PROMOTE_PROTOTYPES, that extra sign extend went away and the fact
that we are doing a 'lbu' unsigned load instead of a 'lb' signed byte
load triggered the bug.  Now I just need to find out why we are doing an
lbu instead of an lb.

Steve Ellcey
sell...@imgtec.com


Reply via email to