[Bug middle-end/27336] "this" pointer is not assumed to be not null

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Aug 20 15:51:00 GMT 2016


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |middle-end

--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This missed optimization is not really specific to *this (nor C++). We also do
not optimize the following as Steven says in comment #5.

extern void g2(A *that) __attribute__((nonnull));
bool f2(A *a) {
  g2(a);
  return a;
}


I guess once we optimize the above, *this will get optimized automatically.


More information about the Gcc-bugs mailing list