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/79310] -Wnonnull false positive on strlen after strstr


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-02-01
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
match.pd is your friend.

(simplify
 (ne (BUILT_IN_STRSTR @0 @1) integer_zerop)
 (with
   {
     unsigned HOST_WIDE_INT string_length;
     const char *p = c_getstr (@1, &string_length);
   }
  (if (p && string_length == 0)
   { constant_boolean_node (type, true); })))

etc.

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