Teach VRP to register assertions along default switch labels (PR18046)
authorPatrick Palka <ppalka@gcc.gnu.org>
Tue, 26 Jul 2016 15:19:58 +0000 (15:19 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Tue, 26 Jul 2016 15:19:58 +0000 (15:19 +0000)
commit524cf1e47a27e8a89390a46235b979e41781f618
treea53f8a1a5848309a51cb3d1a26203dfdbb2631c6
parent100665d8d7460dab7a2c324a50ea8ac720ad9c43
Teach VRP to register assertions along default switch labels (PR18046)

gcc/ChangeLog:

PR tree-optimization/18046
* genmodes.c (emit_mode_size_inline): Emit an assert that
verifies that mode is a valid array index.
(emit_mode_nuinits_inline): Likewise.
(emit_mode_inner_inline): Likewise.
(emit_mode_unit_size_inline): Likewise.
(emit_mode_unit_precision_inline): Likewise.
* tree-vrp.c: Include params.h.
(find_switch_asserts): Register edge assertions for the default
label which correspond to the anti-ranges of each case label.
* params.def (PARAM_MAX_VRP_SWITCH_ASSERTIONS): New.
* doc/invoke.texi: Document it.

gcc/testsuite/ChangeLog:

PR tree-optimization/18046
* gcc.dg/tree-ssa/ssa-dom-thread-6.c: Bump FSM count to 5.
* gcc.dg/tree-ssa/vrp103.c: New test.
* gcc.dg/tree-ssa/vrp104.c: New test.

From-SVN: r238761
gcc/ChangeLog
gcc/doc/invoke.texi
gcc/genmodes.c
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c
gcc/testsuite/gcc.dg/tree-ssa/vrp103.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/vrp104.c [new file with mode: 0644]
gcc/tree-vrp.c