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

--- Comment #4 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
and now I see that his example is mis-compiled too:

cat test1.cpp
int test1(int x)
{
abc:
  x=x+1;
  __builtin_printf("Test %d\n", x);
  if (x<9)
    goto abc;
  return 0;
}


is transformed to this in test1.cpp.178t.tsan0:

int test1(int) (int x)
{
  int D.2636;
  int _7;
  void * _8;

  # x_1 = PHI <x_3(D)(0), x_5(3)>
abc:
  _8 = __builtin_return_address (0);
  __builtin___tsan_func_entry (_8);
  x_5 = x_1 + 1;
  __builtin_printf ("Test %d\n", x_5);
  if (x_5 <= 8)
    goto <bb 3>;
  else
    goto <bb 4>;

  <bb 3>:
  goto <bb 2> (abc);

  <bb 4>:
  _7 = 0;

<L3>:
  __builtin___tsan_func_exit ();
  return _7;

}

with or without r217669, and also if test1.cpp is renamed to test1.c !

Reply via email to