Add sanopt support for UBSAN_PTR.
authorMartin Liska <mliska@suse.cz>
Fri, 6 Oct 2017 14:14:14 +0000 (16:14 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 6 Oct 2017 14:14:14 +0000 (14:14 +0000)
commit513d5564225f8baa2ddeafde9edb9e10b62e30ce
tree520b8fb34932f46c3db23ec5f105b3abe2443dff
parent549d24e9f70e33aac90ddaebf95a63409b058327
Add sanopt support for UBSAN_PTR.

2017-10-06  Martin Liska  <mliska@suse.cz>

* 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  <mliska@suse.cz>

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

From-SVN: r253492
gcc/ChangeLog
gcc/sanopt.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/ptr-overflow-sanitization-1.c [new file with mode: 0644]