This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ipa/81877] [7/8 Regression] Incorrect results with lto and -fipa-cp and -fipa-cp-clone


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

--- Comment #9 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
I don't understand how LIM may deduce that store sinking is safe without
considering may-alias relations. If it is UB to write the same object from
different declared-independent iterations, then I think the correct deduction
would be "iteration count is at most 1", not "store sinking is safe"?


A C++ variation of the test, doesn't need -fno-tree-sra or asm() shenanigans:

void g(int p, int *out)
{
  int x = 0, y;
#pragma GCC ivdep
  for (int i = 0; i < 100; i++)
    {
      int &r = p ? x : y;
      r = 42;
      out[i] = x;
    }
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]