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 tree-optimization/80944] redundant memcpy/memset with non-constant size not eliminated


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

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Good point!  It never occurred to me.  That explains why no compiler does it.

That suggests that the optimization opportunity is up to the user.  I.e., a
class like std::string could optimize this case by adding a constraint/assert
that s->s doesn't point at s.  Let me look into that.

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