Add sanopt support for UBSAN_PTR.

Programming / Compilers / GCC - marxin [138bc75d-0d04-0410-961f-82ee72b054a4] - 6 October 2017 10:14 EDT

2017-10-06 Martin Liska

- sanopt.c (struct sanopt_tree_triplet_hash): Remove inline keyword for member functions. (struct sanopt_tree_couple): New struct. (struct sanopt_tree_couple_hash): New function. (struct sanopt_ctx): Add new hash_map. (has_dominating_ubsan_ptr_check): New function. (record_ubsan_ptr_check_stmt): Likewise. (maybe_optimize_ubsan_ptr_ifn): Likewise. (sanopt_optimize_walker): Handle IFN_UBSAN_PTR. (pass_sanopt::execute): Handle also SANITIZE_POINTER_OVERFLOW. 2017-10-06 Martin Liska

- c-c++-common/ubsan/ptr-overflow-sanitization-1.c: New test.

df7bbf0 Add sanopt support for UBSAN_PTR.
gcc/ChangeLog | 13 +
gcc/sanopt.c | 268 ++++++++++++++++++++-
gcc/testsuite/ChangeLog | 4 +
.../ubsan/ptr-overflow-sanitization-1.c | 80 ++++++
4 files changed, 352 insertions(+), 13 deletions(-)

Upstream: gcc.gnu.org


  • Share