While testing gmp on the riscv target I discovered a compare bug.
(t-get_d test fails in directory tests/mpq)

The code:

#include <stdio.h>

int tst(void) {
  long value = 3;
  return -value;
}

int main(void) {
  printf ("%d\n", tst());
  if (tst() > 0) printf ("error\n");
  return 0;
}

prints "error" on the riscv target. The problem is that the value returned is converted from long to int in gen_cast and is returned as 0xfffffffd from tst().
The compare in the main code fails because it does a long compare
instead of an int compare.

    Herman

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to