diff options
author | Martin Liska <mliska@suse.cz> | 2021-05-20 09:32:29 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-05-25 14:56:28 +0200 |
commit | cec4d4a6782c9bd8d071839c50a239c49caca689 (patch) | |
tree | 53cfafb14a918bd28342e2288ce210becd6bb35b /gcc/tree-ssa-ifcombine.c | |
parent | f5c6b71c9b02a2b2e0b7107d982def09abeeae88 (diff) | |
download | gcc-cec4d4a6782c9bd8d071839c50a239c49caca689.zip gcc-cec4d4a6782c9bd8d071839c50a239c49caca689.tar.gz gcc-cec4d4a6782c9bd8d071839c50a239c49caca689.tar.bz2 |
Add no_sanitize_coverage attribute.
gcc/ChangeLog:
* asan.h (sanitize_coverage_p): New function.
* doc/extend.texi: Document it.
* fold-const.c (fold_range_test): Use sanitize_flags_p
instead of flag_sanitize_coverage.
(fold_truth_andor): Likewise.
* sancov.c: Likewise.
* tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise.
* ipa-inline.c (sanitize_attrs_match_for_inline_p): Handle
-fsanitize-coverage when inlining.
gcc/c-family/ChangeLog:
* c-attribs.c (handle_no_sanitize_coverage_attribute): New.
gcc/testsuite/ChangeLog:
* gcc.dg/sancov/attribute.c: New test.
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r-- | gcc/tree-ssa-ifcombine.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c index 836a12d..f93e04a 100644 --- a/gcc/tree-ssa-ifcombine.c +++ b/gcc/tree-ssa-ifcombine.c @@ -40,6 +40,8 @@ along with GCC; see the file COPYING3. If not see #include "gimplify-me.h" #include "tree-cfg.h" #include "tree-ssa.h" +#include "attribs.h" +#include "asan.h" #ifndef LOGICAL_OP_NON_SHORT_CIRCUIT #define LOGICAL_OP_NON_SHORT_CIRCUIT \ @@ -567,7 +569,7 @@ ifcombine_ifandif (basic_block inner_cond_bb, bool inner_inv, if (param_logical_op_non_short_circuit != -1) logical_op_non_short_circuit = param_logical_op_non_short_circuit; - if (!logical_op_non_short_circuit || flag_sanitize_coverage) + if (!logical_op_non_short_circuit || sanitize_coverage_p ()) return false; /* Only do this optimization if the inner bb contains only the conditional. */ if (!gsi_one_before_end_p (gsi_start_nondebug_after_labels_bb (inner_cond_bb))) |