re PR sanitizer/68418 (ubsan complains about left shifts even with -fwrapv)
authorPaolo Bonzini <bonzini@gnu.org>
Sat, 12 Dec 2015 08:29:27 +0000 (08:29 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Sat, 12 Dec 2015 08:29:27 +0000 (08:29 +0000)
commitb300764434b6e25bbab71e8de38987d288cfd703
treec6d37a44fa512582906ef96d63d3924eaf03937f
parentaa31006f5d68298d48dee002d57c7af1ac1ec438
re PR sanitizer/68418 (ubsan complains about left shifts even with -fwrapv)

gcc:
PR sanitizer/68418
* c-family/c-ubsan.c (ubsan_instrument_shift): Disable
sanitization of left shifts for wrapping signed types as well.

gcc/testsuite:
PR sanitizer/68418
* gcc.dg/ubsan/c99-wrapv-shift-1.c,
gcc.dg/ubsan/c99-wrapv-shift-2.c: New testcases.

From-SVN: r231582
gcc/ChangeLog
gcc/c-family/c-ubsan.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ubsan/c99-wrapv-shift-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ubsan/c99-wrapv-shift-2.c [new file with mode: 0644]