https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111151

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The following testcase at least reproduces the unsigned multiplication issue,
but doesn't reproduce the signed multiplication nor division by -1.
int
main ()
{
  unsigned a = (1U + __INT_MAX__) / 2U;
  unsigned b = 1U;
  unsigned c = (a * 2U > b * 2U ? a * 2U : b * 2U) * 2U;
  if (c != 0U)
    __builtin_abort ();
  int d = (-__INT_MAX__ - 1) / 2;
  int e = 10;
  int f = (d * 2 > e * 2 ? d * 2 : e * 2) * 6;
  if (f != 120)
    __builtin_abort ();
  int g = (-__INT_MAX__ - 1) / 2;
  int h = 0;
  int i = (g * 2 > h * 2 ? g * 2 : h * 2) / -1;
  if (i != 0)
    __builtin_abort ();
}

Reply via email to