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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[16/17 Regression] Wrong    |[13/14/15/16/17 Regression]
                   |code with                   |Wrong code with
                   |spaceship_replacement since |spaceship_replacement since
                   |r16-3474                    |r12-964
   Target Milestone|16.2                        |13.5

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If the
[[gnu::noipa]] int
foo (int x, int y)
{
  int c = -128;
  if (x == y)
    c = 0;
  else if (x < y)
    c = -1;
  else if (x <= y)
    c = 1;
  return c > 0;
}

int
main ()
{
  int i, j;
  for (i = -3; i <= 3; i++)
    for (j = -3; j <= 3; j++)
      if (foo (i, j) != 0)
        __builtin_abort ();
}
testcase for 16/17 is changed to
__attribute__((noipa)) int
foo (int x, int y)
{
  int c = 2;
  if (x == y)
    c = 0;
  else if (x < y)
    c = -1;
  else if (x <= y)
    c = 1;
  return c == 1;
}

int
main ()
{
  int i, j;
  for (i = -3; i <= 3; i++)
    for (j = -3; j <= 3; j++)
      if (foo (i, j) != 0)
        __builtin_abort ();
}
for older gcc versions, it fails all the way back to
r12-964-gf1c777f40aa0b6941efc7440495a8d7e0cc2a1bb

Reply via email to