This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]