bagel99 / llvm-my66000

This is a fork of the LLVM project. The code in branch my66000 supports Mitch Alsup's MY66000. The code in branch mcore supports the Motorola MCore.
http://llvm.org
Other
2 stars 2 forks source link

Cannot select smul_lohi #23

Closed tkoenig1 closed 1 year ago

tkoenig1 commented 1 year ago

Here's another from the gcc testsuite, for __builtin_mul_overflow, apparently:

/* PR tree-optimization/64006 */

int v;

long __attribute__ ((noinline, noclone))
test (long *x, int y)
{
  int i;
  long s = 1;
  for (i = 0; i < y; i++)
    if (__builtin_mul_overflow (s, x[i], &s))
      v++;
  return s;
}

int
main ()
{
  long d[7] = { 975, 975, 975, 975, 975, 975, 975 };
  long r = test (d, 7);
  if (sizeof (long) * __CHAR_BIT__ == 64 && v != 1)
    __builtin_abort ();
  else if (sizeof (long) * __CHAR_BIT__ == 32 && v != 4)
    __builtin_abort ();
  return 0;
}

pr64006.zip

bagel99 commented 1 year ago

Try again with commit c66d22534c5a05431beb6fbd7573c66aff89f12b

tkoenig1 commented 1 year ago

Works, closing.