flag-types.h (enum sanitize_code): Add SANITIZE_SHIFT_BASE and SANITIZE_SHIFT_EXPONENT...
authorJakub Jelinek <jakub@redhat.com>
Wed, 9 Nov 2016 15:37:28 +0000 (16:37 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 9 Nov 2016 15:37:28 +0000 (16:37 +0100)
commit2e955d50a928eac736c1e4a6eddc932d3400200a
tree03880b28e03c433d65f4c40b64eec608dd81fdb0
parent14e7281244ddf777d822f1e99518f0e15b0bfea6
flag-types.h (enum sanitize_code): Add SANITIZE_SHIFT_BASE and SANITIZE_SHIFT_EXPONENT...

* flag-types.h (enum sanitize_code): Add SANITIZE_SHIFT_BASE
and SANITIZE_SHIFT_EXPONENT, change SANITIZE_SHIFT to bitwise
or of them, renumber other enumerators.
* opts.c (sanitizer_opts): Add shift-base and shift-exponent.
* doc/invoke.texi: Document -fsanitize=shift-base and
-fsanitize-shift-exponent, document -fsanitize=shift as
having those 2 suboptions.
c-family/
* c-ubsan.c (ubsan_instrument_shift): Handle split
-fsanitize=shift-base and -fsanitize=shift-exponent.
testsuite/
* gcc.dg/ubsan/c99-shift-3.c: New test.
* gcc.dg/ubsan/c99-shift-4.c: New test.
* gcc.dg/ubsan/c99-shift-5.c: New test.
* gcc.dg/ubsan/c99-shift-6.c: New test.

From-SVN: r242005
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-ubsan.c
gcc/doc/invoke.texi
gcc/flag-types.h
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ubsan/c99-shift-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ubsan/c99-shift-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ubsan/c99-shift-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ubsan/c99-shift-6.c [new file with mode: 0644]