[Bug tree-optimization/13962] [tree-ssa] make "fold" use alias information to optimize pointer comparisons

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 14 17:42:00 GMT 2014


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

--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
While looking at some unrelated issue, I noticed the following:

  _41 = operator new (28);
...
  if (_41 != &_S_empty_rep_storage)

which happens with a simple use of std::string (with some extra inlining).
__builtin_malloc(42)==&var is not optimized either, so it isn't (only) an issue
with operator new.

If the general case is too dangerous, maybe there is at least some subset that
could safely be optimized?



More information about the Gcc-bugs mailing list