[PATCH] Fix PR14495 (2/2)

Diego Novillo dnovillo@google.com
Tue Apr 1 23:23:00 GMT 2008


[ Apologies for the duplicate.  The first one was rejected by the list. ]

2008/3/28 Richard Guenther <rguenther@suse.de <mailto: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/vrp39.c: New testcase.
 > * gcc.dg/tree-ssa/vrp40.c: Likewise.

OK. Two nits:

 > + /* We only can handle integer ranges. */

s/only can/can only/

 > + }
 > + /* Queue not needed edges for later removal. */

Blank line before comment.

Rafael, the next tuples merge will need some fixes in this area. The
default label is treated differently in tuples (it's the first label
of the vector).


Diego.



More information about the Gcc-patches mailing list