re PR middle-end/67338 (fold-const sanitizer runtime error in roundup_loc)
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Mar 2017 08:10:30 +0000 (09:10 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 21 Mar 2017 08:10:30 +0000 (09:10 +0100)
commit9f30dff0eed2813ead7a2e2927e0eb8c333baf8b
tree25395a0bf3f57d3e2ac54445b270b159ac79d661
parent9da12bea7dd6fe01bdb2fc559f22901e0e59b6ca
re PR middle-end/67338 (fold-const sanitizer runtime error  in roundup_loc)

PR c/67338
* fold-const.c (round_up_loc): Negate divisor in unsigned type to
avoid UB.

* gcc.dg/pr67338.c: New test.

From-SVN: r246305
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr67338.c [new file with mode: 0644]