Hi,
Sorry for disturbind all of you through this mailing list.
I am looking for a way to report an optimization issue which I inspected when compiled a C code with clang using -Oz optimization option (-O2/3 also reproduces it).
I posted this to SO (https://stackoverflow.com/questions/58407841/does-clang-misunderstand-the-const-pointer-specifier) but still got no satisfying answer.
Thank you for your help,
Alex.
/looks/ necessary to me. As one of the replies said: “The event_t member of queue_ptr could point at the same memory as event_ptr.”
This means that this line “queue_ptr->queue[queue_ptr->wr_idx++] = *event_ptr;” invalidates all the loads through queue_ptr before it, and they have to be loaded again after this (because queue_ptr->queue might point into the same memory that queue_ptr points into, so the assignment might’ve modified the things queue_ptr points to)
On Thu, Oct 24, 2019 at 11:23 AM אלכס לופ’ via llvm-dev <llvm-dev@lists.llvm.org> wrote: