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 c++/70178] Loop-invariant memory loads from std::string innards are not hoisted


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70178

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
This is because we don't know that for

struct string { char *data; } s;

s->data doesn't point to &s->data and thus writing to s->data[i] may invalidate
the pointer.  Unfortunately 'char' aliases everything so writing to a char *
object and then reading back as char * is valid from a TBAA perspective.

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