Disable an unsafe VRP transformation when -fno-strict-overflow is set
authorPatrick Palka <ppalka@gcc.gnu.org>
Thu, 20 Nov 2014 22:25:35 +0000 (22:25 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Thu, 20 Nov 2014 22:25:35 +0000 (22:25 +0000)
commit7ac753f9683133e7b91f2d497ab6b25418a05c5d
tree50fdade7d7ba6205c00a1d0613c261fa0f192e1f
parent75bda2e8134c013bc3d02b78e5b8b34022961985
Disable an unsafe VRP transformation when -fno-strict-overflow is set

gcc/
* tree-vrp.c (test_for_singularity): New parameter
strict_overflow_p.  Set *strict_overflow_p to true if signed
overflow must be undefined for the return value to satisfy the
conditional.
(simplify_cond_using_ranges): Don't perform the simplification
if it violates overflow rules.

gcc/testsuite/
* gcc.dg/no-strict-overflow-8.c: New test.

From-SVN: r217895
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/no-strict-overflow-8.c [new file with mode: 0644]
gcc/tree-vrp.c