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.