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 middle-end/27336] delete null checks in callers to nonnull functions


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
----------------------------------------------------------------------------
            Summary|"this" pointer is not       |delete null checks in
                   |assumed to be not null      |callers to nonnull
                   |                            |functions

--- Comment #10 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
For the following:

struct B { int x; };
extern void g3(struct B *that)  __attribute__((nonnull));
bool f3(struct B *a) {
  g3(a);
  return a;
}

The GIMPLE dump for C and C++ looks the same, but the NULL check in C++ does
not get optimized out.

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