[Bug c++/82505] g++ -O3 -funroll-loops generates weird code
amonakov at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 10 16:46:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82505
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |amonakov at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
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 *)&src;' prior to invoking t2
(then the loop in t2 modifies src on each iteration, and also reads a byte of
its representation).
More information about the Gcc-bugs
mailing list