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 anything in the function? The current behaviour pessimizes any code that does byte I/O with classes, if I understand the rules correcly: - for const char* it assumes that members might be read through the ptr, so it stores them back after an update - for char* it assumes that after a write, any members in registers must be re-loaded as the write might have changed them.