re PR tree-optimization/14495 ([tree-ssa] Propagate range info into a switch statement)
commitb7814a183ca564e2d8cf21c12364d13d8f1226a2
authorRichard Guenther <rguenther@suse.de>
Wed, 2 Apr 2008 12:54:08 +0000 (2 12:54 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 2 Apr 2008 12:54:08 +0000 (2 12:54 +0000)
treeaff8bcca1cbe2777fd11b65bc13de7e52af54d3b
parent8aea0bf08194b3bb9699c0a71ad02284b7a4ebc0
re PR tree-optimization/14495 ([tree-ssa] Propagate range info into a switch statement)

2008-04-02  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/14495
PR tree-optimization/34793
* tree-vrp.c (struct switch_update): New structure.
(to_remove_edges, to_update_switch_stmts): New VECs.
(simplify_switch_using_ranges): New function.  Remove not taken
case labels and edges.
(simplify_stmt_using_ranges): Call it.
(identify_jump_threads): Mark edges we have queued for removal
so we don't thread them.
(execute_vrp): Remove edges queued for removal, update SWITCH_STMT
case label vector.
* tree-cfg.c (group_case_labels): Deal with missing default label.
(tree_verify_flow_info): Allow missing default label.
* stmt.c (emit_case_bit_tests): Deal with NULL default_label.
(emit_case_nodes): Likewise.
(expand_case): Do not rely on the default label to be present.
* expr.c (try_casesi): Deal with NULL default_label.
(do_tablejump): Likewise.

* gcc.dg/tree-ssa/vrp41.c: New testcase.
* gcc.dg/tree-ssa/vrp42.c: Likewise.

From-SVN: r133835
gcc/ChangeLog
gcc/expr.c
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/vrp41.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/vrp42.c [new file with mode: 0644]
gcc/tree-cfg.c
gcc/tree-vrp.c