Teach VRP to truncate the case ranges of a switch
authorPatrick Palka <ppalka@gcc.gnu.org>
Fri, 5 Aug 2016 00:07:16 +0000 (00:07 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Fri, 5 Aug 2016 00:07:16 +0000 (00:07 +0000)
commit48abe922252d8831e7a3724173a22361d900da0b
treeb47577953fa80571511c54d5252f93dfb24abb32
parent383321ecc99a881f9f1a8249295d23e717cbdf7e
Teach VRP to truncate the case ranges of a switch

gcc/ChangeLog:

* tree-vrp.c (simplify_switch_using_ranges): Try to truncate
the case label ranges that partially overlap with OP's value
range.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/vrp107.c: New test.
* gcc.dg/tree-ssa/vrp108.c: New test.
* gcc.dg/tree-ssa/vrp109.c: New test.

From-SVN: r239157
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/vrp107.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/vrp108.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/vrp109.c [new file with mode: 0644]
gcc/tree-vrp.c