https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69835
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Tue Feb 16 20:46:17 2016 New Revision: 233472 URL: https://gcc.gnu.org/viewcvs?rev=233472&root=gcc&view=rev Log: PR c/69835 * common.opt (Wnonnull-compare): New warning. * doc/invoke.texi (-Wnonnull): Remove text about comparison of arguments against NULL. (-Wnonnull-compare): Document. * Makefile.in (OBJS): Add gimple-ssa-nonnull-compare.o. * tree-pass.h (make_pass_warn_nonnull_compare): Declare. * passes.def (pass_warn_nonnull_compare): Add. * gimple-ssa-nonnull-compare.c: New file. c-family/ * c.opt (Wnonnull-compare): Enable for -Wall. c/ * c-typeck.c (build_binary_op): Revert 2015-09-09 change. cp/ * typeck.c (cp_build_binary_op): Revert 2015-09-09 change. testsuite/ * c-c++-common/nonnull-1.c: Use -Wnonnull-compare instead of -Wnonnull in dg-options. * c-c++-common/nonnull-2.c: New test. Added: trunk/gcc/gimple-ssa-nonnull-compare.c trunk/gcc/testsuite/c-c++-common/nonnull-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/Makefile.in trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c.opt trunk/gcc/c/ChangeLog trunk/gcc/c/c-typeck.c trunk/gcc/common.opt trunk/gcc/cp/ChangeLog trunk/gcc/cp/typeck.c trunk/gcc/doc/invoke.texi trunk/gcc/passes.def trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/c-c++-common/nonnull-1.c trunk/gcc/tree-pass.h