]> git.ipfire.org Git - thirdparty/gcc.git/commit
fold-const.c (fold_negate_expr): Don't fold INTEGER_CST if that overflows when SANITI...
authorMarek Polacek <polacek@redhat.com>
Fri, 14 Nov 2014 11:57:05 +0000 (11:57 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 14 Nov 2014 11:57:05 +0000 (11:57 +0000)
commitc7274165bd25121e2d7562718904f12126bf1b1e
treee658bdd67d7d906e29048429d363eaa3f48eaab0
parent4088b790cc40b0fbcf12bafd1e3ef822c976a702
fold-const.c (fold_negate_expr): Don't fold INTEGER_CST if that overflows when SANITIZE_SI_OVERFLOW is on.

* fold-const.c (fold_negate_expr): Don't fold INTEGER_CST if
that overflows when SANITIZE_SI_OVERFLOW is on.  Guard -(-A)
folding with TYPE_OVERFLOW_SANITIZED.

* c-c++-common/ubsan/overflow-negate-3.c: New test.

From-SVN: r217556
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/overflow-negate-3.c [new file with mode: 0644]