[Bug middle-end/85637] Unneeded store of member variables in inner loop

2021-08-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85637 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug middle-end/85637] Unneeded store of member variables in inner loop

2018-05-04 Thread petschy at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85637 --- Comment #5 from petschy at gmail dot com --- Thanks, in this specific case __restrict works indeed. On a side note, is it possible to achieve the same when a char is stored through a char* member, and also incremented? eg: if (m_cur < m_end)

[Bug middle-end/85637] Unneeded store of member variables in inner loop

2018-05-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85637 --- Comment #4 from Richard Biener --- Err, wrong function assembly pasted. Note you also can make this * restrict via __attribute__((noinline)) void Update(const void* b, unsigned int len) __restrict { i

[Bug middle-end/85637] Unneeded store of member variables in inner loop

2018-05-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85637 --- Comment #3 from Richard Biener --- __restrict should work fine for char pointers. With __attribute__((noinline)) void Update(const void* __restrict b, unsigned int len) { if (len) { ... I get with -O

[Bug middle-end/85637] Unneeded store of member variables in inner loop

2018-05-03 Thread petschy at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85637 --- Comment #2 from petschy at gmail dot com --- Thanks. For non-char types, one can use __restrict on ptrs, but for chars it doesn't work, unfortunately (strict aliasing rules). Is there a way to tell the compiler that a char ptr doesn't alias an

[Bug middle-end/85637] Unneeded store of member variables in inner loop

2018-05-03 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85637 --- Comment #1 from Andrew Pinski --- This is most likely because unsigned char is considered as aliasing any type. That means the write to this->m_s1 and this->m_s2 can be read via *buf