[Bug c++/82505] g++ -O3 -funroll-loops generates weird code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82505 --- Comment #6 from Jonathan Wakely --- Ah no, because we have global pointers here, with potentially unknowable aliasing, as Alexander said.
[Bug c++/82505] g++ -O3 -funroll-loops generates weird code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82505 --- Comment #5 from Jonathan Wakely --- dup of PR 82394?
[Bug c++/82505] g++ -O3 -funroll-loops generates weird code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82505 Alexander Monakov changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC||amonakov at gcc dot gnu.org Resolution|--- |INVALID --- Comment #4 from Alexander Monakov --- t2 needs more code simply because it does more work: in C you can read representations of objects byte-by-byte via 'char *' pointers. Consider what happens if src is initialized like 'src = (void *)' prior to invoking t2 (then the loop in t2 modifies src on each iteration, and also reads a byte of its representation).
[Bug c++/82505] g++ -O3 -funroll-loops generates weird code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82505 --- Comment #3 from David Barto --- I understand that it can't optimize much, my major concern is that the pointer version of the code is so much worse than the index version of the code.
[Bug c++/82505] g++ -O3 -funroll-loops generates weird code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82505 --- Comment #2 from Marc Glisse --- dest/src might alias anything (even themselves), so the compiler can't really optimize much.
[Bug c++/82505] g++ -O3 -funroll-loops generates weird code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82505 --- Comment #1 from David Barto --- This is gcc-mp-7 pre-built object from MacPorts. Should have mentioned that.