Commit 3f10efd4 by Martin Liska Committed by Martin Liska

Fix bit-test expansion for single cluster (PR tree-optimization/86263).

2018-06-29  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/86263
	* tree-switch-conversion.c (switch_decision_tree::try_switch_expansion):
        Make edge redirection.
2018-06-29  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/86263
	* gcc.dg/tree-ssa/pr86263.c: New test.

From-SVN: r262247
parent 6475e077
2018-06-29 Martin Liska <mliska@suse.cz>
PR tree-optimization/86263
* tree-switch-conversion.c (switch_decision_tree::try_switch_expansion):
Make edge redirection.
2018-06-29 David Malcolm <dmalcolm@redhat.com>
* dumpfile.c (dump_loc): Add indentation based on scope depth.
......
2018-06-29 Martin Liska <mliska@suse.cz>
PR tree-optimization/86263
* gcc.dg/tree-ssa/pr86263.c: New test.
2018-06-28 Carl Love <cel@us.ibm.com>
* gcc.target/p9-extract-1.c: Add test case.
......
/* { dg-do compile } */
void f1 (void *);
void f2 (void *);
void f3 (void *);
void f4 (void *);
char
_dcvt (void *ptr, char type, int opt, int val)
{
switch (type)
{
case 'f':
f4 (ptr);
case 'F':
f1 (ptr);
break;
case 'g':
case 'G':
if (opt == 0)
opt = 1;
f2 (ptr);
break;
case 'e':
case 'E':
f3 (ptr);
}
return val;
}
......@@ -1732,8 +1732,12 @@ switch_decision_tree::try_switch_expansion (vec<cluster *> &clusters)
/* Do not do an extra work for a single cluster. */
if (clusters.length () == 1
&& clusters[0]->get_type () != SIMPLE_CASE)
clusters[0]->emit (index_expr, index_type,
gimple_switch_default_label (m_switch), m_default_bb);
{
cluster *c = clusters[0];
c->emit (index_expr, index_type,
gimple_switch_default_label (m_switch), m_default_bb);
redirect_edge_succ (single_succ_edge (bb), c->m_case_bb);
}
else
{
emit (bb, index_expr, default_edge->probability, index_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment