diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-05 17:36:29 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-05 17:36:29 +0000 |
commit | 254d68a930fa4cd7a429910706454830d6b7ef07 (patch) | |
tree | 95eb22912610de69685ef6ec213edea83c4c6c6d /gcc/common.opt | |
parent | 373f5172dd219254b2f0fb6ce3553c25eb98c61e (diff) | |
download | gcc-254d68a930fa4cd7a429910706454830d6b7ef07.tar.gz |
gcc/ChangeLog:
2015-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
Jeff Law <law@redhat.com>
PR c/16351
* doc/invoke.texi (Wnull-dereference): New.
* tree-vrp.c (infer_value_range): Update call to infer_nonnull_range.
* gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour):
Warn for potential NULL dereferences.
(find_explicit_erroneous_behaviour): Warn for NULL dereferences.
* ubsan.c (instrument_nonnull_arg): Call
infer_nonnull_range_by_attribute.
(instrument_nonnull_return): Likewise.
* common.opt (Wnull-dereference); New.
* gimple.c (infer_nonnull_range): Remove bool arguments.
(infer_nonnull_range_by_dereference): New.
(infer_nonnull_range_by_attribute): New.
* gimple.h: Update declarations.
gcc/testsuite/ChangeLog:
2015-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
Jeff Law <law@redhat.com>
PR c/16351
* gcc.dg/tree-ssa/isolate-2.c: Close comment.
* gcc.dg/tree-ssa/isolate-4.c: Likewise.
* gcc.dg/tree-ssa/wnull-dereference.c: New test.
* gcc.dg/tree-ssa/isolate-1.c: Test warnings with -Wnull-dereference.
* gcc.dg/tree-ssa/isolate-3.c: Likewise.
* gcc.dg/tree-ssa/isolate-5.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226640 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/common.opt')
-rw-r--r-- | gcc/common.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/common.opt b/gcc/common.opt index 8f25f8b35cf..fb9e9daa754 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -592,6 +592,10 @@ Wlarger-than= Common RejectNegative Joined UInteger Warning -Wlarger-than=<number> Warn if an object is larger than <number> bytes +Wnull-dereference +Common Var(warn_null_dereference) Warning EnabledBy(Wall) +Warn if dereferencing a NULL pointer may lead to erroneous or undefined behavior + Wunsafe-loop-optimizations Common Var(warn_unsafe_loop_optimizations) Warning Warn if the loop cannot be optimized due to nontrivial assumptions. |