diff options
author | Peter Bergner <bergner@vnet.ibm.com> | 2017-05-10 11:44:45 -0500 |
---|---|---|
committer | Peter Bergner <bergner@gcc.gnu.org> | 2017-05-10 11:44:45 -0500 |
commit | ca4d28516878755a01ab8c2ba48d083100aba3fb (patch) | |
tree | 70d19af5ced974c859545f07f4ad66c75b41b3be /gcc/tree-ssa-ccp.c | |
parent | 415dcf965368a67599b93579848181ecec24f860 (diff) | |
download | gcc-ca4d28516878755a01ab8c2ba48d083100aba3fb.zip gcc-ca4d28516878755a01ab8c2ba48d083100aba3fb.tar.gz gcc-ca4d28516878755a01ab8c2ba48d083100aba3fb.tar.bz2 |
tree-cfg.c (gimple_seq_unreachable_p): New function.
gcc/
* tree-cfg.c (gimple_seq_unreachable_p): New function.
(assert_unreachable_fallthru_edge_p): Use it.
(group_case_labels_stmt): Likewise.
* tree-cfg.h: Prototype it.
* stmt.c: Include cfghooks.h and tree-cfg.h.
(emit_case_dispatch_table) <gap_label>: New local variable.
Use it to fill dispatch table gaps.
Test for default_label before updating probabilities.
(expand_case) <default_label>: Remove unneeded initialization.
Test for unreachable default case statement and remove its edge.
Set default_label accordingly.
* tree-ssa-ccp.c (optimize_unreachable): Update comment.
gcc/testsuite/
* gcc.target/powerpc/pr51513.c: New test.
* gcc.dg/predict-13.c: Replace __builtin_unreachable() with
__builtin_abort().
* gcc.dg/predict-14.c: Likewise.
From-SVN: r247844
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 23f2adcb..80dcae5 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2715,7 +2715,8 @@ optimize_unreachable (gimple_stmt_iterator i) } else { - /* Todo: handle other cases, f.i. switch statement. */ + /* Todo: handle other cases. Note that unreachable switch case + statements have already been removed. */ continue; } |