public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [PATCH 17/45] analyzer: command-line options
Date: Fri, 13 Dec 2019 18:12:00 -0000	[thread overview]
Message-ID: <20191213181134.1830-18-dmalcolm@redhat.com> (raw)
In-Reply-To: <20191213181134.1830-1-dmalcolm@redhat.com>

Changed in v4:
- Renamed gcc/analyzer/plugin.opt to gcc/analyzer/analyzer.opt

- Change option from -analyzer to -fanalyzer, changed it from
  Driver to Common.

- Various commits on 2019-11-12 including r278083 through r278087
  reimplemented parameter-handling in terms of options, so that
  params are defined in params.opt rather than params.def.

  This patch adds the params for the analyzer to analyzer.opt,
  replacing the patch:
    [PATCH 22/49] analyzer: params.def: new parameters
      https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01520.html
  from the original version of the patch kit.

- Added -Wanalyzer-unsafe-call-within-signal-handler from
    https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00214.html

This patch contains the command-line options for the analyzer.

gcc/ChangeLog:
	* analyzer/analyzer.opt: New file.
	* common.opt (-fanalyzer): New driver option.
---
 gcc/analyzer/analyzer.opt | 181 ++++++++++++++++++++++++++++++++++++++
 gcc/common.opt            |   4 +
 2 files changed, 185 insertions(+)
 create mode 100644 gcc/analyzer/analyzer.opt

diff --git a/gcc/analyzer/analyzer.opt b/gcc/analyzer/analyzer.opt
new file mode 100644
index 000000000000..d722667dea09
--- /dev/null
+++ b/gcc/analyzer/analyzer.opt
@@ -0,0 +1,181 @@
+; plugin.opt -- Options for the analyzer.
+
+; Copyright (C) 2019 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+; 
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+; 
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3.  If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual for a description of this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+-param=analyzer-bb-explosion-factor=
+Common Joined UInteger Var(param_analyzer_bb_explosion_factor) Init(5) Param
+The maximum number of 'after supernode' exploded nodes within the analyzer per supernode, before terminating analysis.
+
+-param=analyzer-max-enodes-per-program-point=
+Common Joined UInteger Var(param_analyzer_max_enodes_per_program_point) Init(8) Param
+The maximum number of exploded nodes per program point within the analyzer, before terminating analysis of that point.
+
+-param=analyzer-max-recursion-depth=
+Common Joined UInteger Var(param_analyzer_max_recursion_depth) Init(2) Param
+The maximum number of times a callsite can appear in a call stack within the analyzer, before terminating analysis of a call tha would recurse deeper.
+
+-param=analyzer-min-snodes-for-call-summary=
+Common Joined UInteger Var(param_analyzer_min_snodes_for_call_summary) Init(10) Param
+The minimum number of supernodes within a function for the analyzer to consider summarizing its effects at call sites.
+
+Wanalyzer-double-fclose
+Common Var(warn_analyzer_double_fclose) Init(1) Warning
+Warn about code paths in which a stdio FILE can be closed more than once.
+
+Wanalyzer-double-free
+Common Var(warn_analyzer_double_free) Init(1) Warning
+Warn about code paths in which a pointer can be freed more than once.
+
+Wanalyzer-exposure-through-output-file
+Common Var(warn_analyzer_exposure_through_output_file) Init(1) Warning
+Warn about code paths in which sensitive data is written to a file.
+
+Wanalyzer-file-leak
+Common Var(warn_analyzer_file_leak) Init(1) Warning
+Warn about code paths in which a stdio FILE is not closed.
+
+Wanalyzer-free-of-non-heap
+Common Var(warn_analyzer_free_of_non_heap) Init(1) Warning
+Warn about code paths in which a non-heap pointer is freed.
+
+Wanalyzer-malloc-leak
+Common Var(warn_analyzer_malloc_leak) Init(1) Warning
+Warn about code paths in which a heap-allocated pointer leaks.
+
+Wanalyzer-possible-null-argument
+Common Var(warn_analyzer_possible_null_argument) Init(1) Warning
+Warn about code paths in which a possibly-NULL value is passed to a must-not-be-NULL function argument.
+
+Wanalyzer-possible-null-dereference
+Common Var(warn_analyzer_possible_null_dereference) Init(1) Warning
+Warn about code paths in which a possibly-NULL pointer is dereferenced.
+
+Wanalyzer-unsafe-call-within-signal-handler
+Common Var(warn_analyzer_unsafe_call_within_signal_handler) Init(1) Warning
+Warn about code paths in which an async-signal-unsafe function is called from a signal handler.
+
+Wanalyzer-null-argument
+Common Var(warn_analyzer_null_argument) Init(1) Warning
+Warn about code paths in which NULL is passed to a must-not-be-NULL function argument.
+
+Wanalyzer-null-dereference
+Common Var(warn_analyzer_null_dereference) Init(1) Warning
+Warn about code paths in which a NULL pointer is dereferenced.
+
+Wanalyzer-stale-setjmp-buffer
+Common Var(warn_analyzer_stale_setjmp_buffer) Init(1) Warning
+Warn about code paths in which a longjmp rewinds to a jmp_buf saved in a stack frame that has returned.
+
+Wanalyzer-tainted-array-index
+Common Var(warn_analyzer_tainted_array_index) Init(1) Warning
+Warn about code paths in which an unsanitized value is used as an array index.
+
+Wanalyzer-use-after-free
+Common Var(warn_analyzer_use_after_free) Init(1) Warning
+Warn about code paths in which a freed value is used.
+
+Wanalyzer-use-of-pointer-in-stale-stack-frame
+Common Var(warn_analyzer_use_of_pointer_in_stale_stack_frame) Init(1) Warning
+Warn about code paths in which a pointer to a stale stack frame is used.
+
+Wanalyzer-use-of-uninitialized-value
+Common Var(warn_analyzer_use_of_uninitialized_value) Init(1) Warning
+Warn about code paths in which an initialized value is used.
+
+Wanalyzer-too-complex
+Common Var(warn_analyzer_too_complex) Init(0) Warning
+Warn if the code is too complicated for the analyzer to fully explore.
+
+fanalyzer-checker=
+Common Joined RejectNegative Var(flag_analyzer_checker)
+Restrict the analyzer to run just the named checker.
+
+fanalyzer-fine-grained
+Common Var(flag_analyzer_fine_grained) Init(0)
+Avoid combining multiple statements into one exploded edge.
+
+fanalyzer-state-purge
+Common Var(flag_analyzer_state_purge) Init(1)
+Purge unneeded state during analysis.
+
+fanalyzer-state-merge
+Common Var(flag_analyzer_state_merge) Init(1)
+Merge similar-enough states during analysis.
+
+fanalyzer-transitivity
+Common Var(flag_analyzer_transitivity) Init(0)
+Enable transitivity of constraints during analysis.
+
+fanalyzer-call-summaries
+Common Var(flag_analyzer_call_summaries) Init(0)
+Approximate the effect of function calls to simplify analysis.
+
+fanalyzer-verbose-edges
+Common Var(flag_analyzer_verbose_edges) Init(0)
+Emit more verbose descriptions of control flow in diagnostics.
+
+fanalyzer-verbose-state-changes
+Common Var(flag_analyzer_verbose_state_changes) Init(0)
+Emit more verbose descriptions of state changes in diagnostics.
+
+fanalyzer-verbosity=
+Common Joined UInteger Var(analyzer_verbosity) Init(2)
+Control which events are displayed in diagnostic paths.
+
+fdump-analyzer
+Common RejectNegative Var(flag_dump_analyzer)
+Dump internal details about what the analyzer is doing to SRCFILE.analyzer.txt.
+
+fdump-analyzer-stderr
+Common RejectNegative Var(flag_dump_analyzer_stderr)
+Dump internal details about what the analyzer is doing to stderr.
+
+fdump-analyzer-callgraph
+Common RejectNegative Var(flag_dump_analyzer_callgraph)
+Dump the analyzer supergraph to a SRCFILE.callgraph.dot file.
+
+fdump-analyzer-exploded-graph
+Common RejectNegative Var(flag_dump_analyzer_exploded_graph)
+Dump the analyzer exploded graph to a SRCFILE.eg.dot file.
+
+fdump-analyzer-exploded-nodes
+Common RejectNegative Var(flag_dump_analyzer_exploded_nodes)
+Emit diagnostics showing the location of nodes in the exploded graph.
+
+fdump-analyzer-exploded-nodes-2
+Common RejectNegative Var(flag_dump_analyzer_exploded_nodes_2)
+Dump a textual representation of the exploded graph to SRCFILE.eg.txt.
+
+fdump-analyzer-exploded-nodes-3
+Common RejectNegative Var(flag_dump_analyzer_exploded_nodes_3)
+Dump a textual representation of the exploded graph to SRCFILE.eg-ID.txt.
+
+fdump-analyzer-state-purge
+Common RejectNegative Var(flag_dump_analyzer_state_purge)
+Dump state-purging information to a SRCFILE.state-purge.dot file.
+
+fdump-analyzer-supergraph
+Common RejectNegative Var(flag_dump_analyzer_supergraph)
+Dump the analyzer supergraph to a SRCFILE.supergraph.dot file.
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/common.opt b/gcc/common.opt
index ae2a14ebadfc..3d1d58d2067e 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -989,6 +989,10 @@ fallow-store-data-races
 Common Report Var(flag_store_data_races) Optimization
 Allow the compiler to introduce new data races on stores.
 
+fanalyzer
+Common Var(flag_analyzer)
+Enable static analysis pass.
+
 fargument-alias
 Common Ignore
 Does nothing. Preserved for backward compatibility.
-- 
2.21.0

  parent reply	other threads:[~2019-12-13 18:12 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 18:12 [PATCH 00/45] v4 of analyzer patch kit David Malcolm
2019-12-13 18:11 ` [PATCH 09/45] Add diagnostic_metadata and CWE support David Malcolm
2019-12-13 18:11 ` [PATCH 04/45] analyzer: internal documentation David Malcolm
2019-12-13 18:11 ` [PATCH 02/45] hash-map-tests.c: add a selftest involving int_hash David Malcolm
2019-12-13 18:11 ` [PATCH 14/45] analyzer: add new files to Makefile.in David Malcolm
2019-12-13 18:11 ` [PATCH 05/45] Add pp_write_text_as_html_like_dot_to_stream David Malcolm
2019-12-16 17:32   ` David Malcolm
2019-12-13 18:12 ` [PATCH 06/45] sbitmap.h: add operator const sbitmap & to auto_sbitmap David Malcolm
2019-12-13 18:12 ` [PATCH 13/45] analyzer: changes to configure.ac David Malcolm
2019-12-13 18:12 ` [PATCH 10/45] Add diagnostic paths David Malcolm
2019-12-13 18:12 ` [PATCH 22/45] analyzer: new files: supergraph.{cc|h} David Malcolm
2019-12-13 18:12 ` [PATCH 24/45] analyzer: new files: tristate.{cc|h} David Malcolm
2019-12-13 18:12 ` [PATCH 27/45] analyzer: new files: pending-diagnostic.{cc|h} David Malcolm
2019-12-13 18:12 ` [PATCH 08/45] Add -fdiagnostics-nn-line-numbers David Malcolm
2019-12-13 18:12 ` [PATCH 39/45] analyzer: new file: exploded-graph.h David Malcolm
2019-12-13 18:12 ` [PATCH 23/45] analyzer: new files: analyzer.{cc|h} David Malcolm
2019-12-13 18:12 ` [PATCH 20/45] analyzer: new files: graphviz.{cc|h} David Malcolm
2019-12-13 18:12 ` [PATCH 19/45] analyzer: new file: analyzer-pass.cc and pass registration David Malcolm
2019-12-13 18:12 ` [PATCH 34/45] analyzer: new file: sm-taint.cc David Malcolm
2019-12-13 18:12 ` [PATCH 32/45] analyzer: new file: sm-sensitive.cc David Malcolm
2019-12-13 18:12 ` [PATCH 18/45] analyzer: logging support David Malcolm
2019-12-13 18:12 ` [PATCH 12/45] timevar.def: add TVs for analyzer David Malcolm
2019-12-13 18:12 ` [PATCH 37/45] analyzer: new files: program-point.{cc|h} David Malcolm
2019-12-13 18:12 ` [PATCH 28/45] analyzer: new files: sm.{cc|h} David Malcolm
2019-12-13 18:12 ` [PATCH 15/45] analyzer: new files: analyzer-selftests.{cc|h} David Malcolm
2019-12-13 18:12 ` David Malcolm [this message]
2019-12-13 18:13 ` [PATCH 44/45] gdbinit.in: add break-on-saved-diagnostic David Malcolm
2019-12-13 18:14 ` [PATCH 41/45] analyzer: new files: engine.{cc|h} David Malcolm
2019-12-13 18:14 ` [PATCH 11/45] Add ordered_hash_map David Malcolm
2019-12-13 18:14 ` [PATCH 42/45] analyzer: new files: checker-path.{cc|h} David Malcolm
2019-12-13 18:15 ` [PATCH 31/45] analyzer: new file: sm-pattern-test.cc David Malcolm
2019-12-13 18:15 ` [PATCH 25/45] analyzer: new files: constraint-manager.{cc|h} David Malcolm
2019-12-13 18:15 ` [PATCH 30/45] analyzer: new file: sm-file.cc David Malcolm
2019-12-13 18:15 ` [PATCH 21/45] analyzer: new files: digraph.{cc|h} and shortest-paths.h David Malcolm
2019-12-13 18:15 ` [PATCH 45/45] analyzer: test suite David Malcolm
2019-12-13 18:16 ` [PATCH 38/45] analyzer: new files: program-state.{cc|h} David Malcolm
2019-12-13 18:16 ` [PATCH 16/45] analyzer: new builtins David Malcolm
2019-12-13 18:27   ` Jakub Jelinek
2019-12-13 18:32     ` David Malcolm
2019-12-18 14:45       ` [PATCH] analyzer: remove __analyzer builtins David Malcolm
2019-12-18 15:06         ` Jakub Jelinek
2019-12-13 18:16 ` [PATCH 01/45] gimple const-correctness fixes David Malcolm
2019-12-13 18:16 ` [PATCH 36/45] analyzer: new files: call-string.{cc|h} David Malcolm
2019-12-13 18:16 ` [PATCH 35/45] analyzer: new files: analysis-plan.{cc|h} David Malcolm
2019-12-13 18:16 ` [PATCH 40/45] analyzer: new files: state-purge.{cc|h} David Malcolm
2019-12-13 18:16 ` [PATCH 29/45] analyzer: new files: sm-malloc.cc and sm-malloc.dot David Malcolm
2019-12-13 18:16 ` [PATCH 26/45] analyzer: new files: region-model.{cc|h} David Malcolm
2019-12-13 18:16 ` [PATCH 33/45] analyzer: new file: sm-signal.cc David Malcolm
2019-12-13 18:16 ` [PATCH 03/45] analyzer: user-facing documentation David Malcolm
2019-12-13 18:16 ` [PATCH 07/45] vec.h: add auto_delete_vec David Malcolm
2019-12-13 18:16 ` [PATCH 43/45] analyzer: new files: diagnostic-manager.{cc|h} David Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191213181134.1830-18-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).