summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-02 12:54:08 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-02 12:54:08 +0000
commit72c30859508c8f41376c420984a0f04963515ad6 (patch)
treeaff8bcca1cbe2777fd11b65bc13de7e52af54d3b /gcc/expr.c
parentb6d7b6c5931190fbca562f92402162aa48e8bd8f (diff)
downloadgcc-72c30859508c8f41376c420984a0f04963515ad6.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133835 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index dbb2b4c468c..a2bd86c4d09 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9851,8 +9851,9 @@ try_casesi (tree index_type, tree index_expr, tree minval, tree range,
index_expr, minval);
minval = integer_zero_node;
index = expand_normal (index_expr);
- emit_cmp_and_jump_insns (rangertx, index, LTU, NULL_RTX,
- omode, 1, default_label);
+ if (default_label)
+ emit_cmp_and_jump_insns (rangertx, index, LTU, NULL_RTX,
+ omode, 1, default_label);
/* Now we can safely truncate. */
index = convert_to_mode (index_mode, index, 0);
}
@@ -9931,8 +9932,9 @@ do_tablejump (rtx index, enum machine_mode mode, rtx range, rtx table_label,
or equal to the minimum value of the range and less than or equal to
the maximum value of the range. */
- emit_cmp_and_jump_insns (index, range, GTU, NULL_RTX, mode, 1,
- default_label);
+ if (default_label)
+ emit_cmp_and_jump_insns (index, range, GTU, NULL_RTX, mode, 1,
+ default_label);
/* If index is in range, it must fit in Pmode.
Convert to Pmode so we can index with it. */