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
This commit is contained in:
parent
6475e077a0
commit
3f10efd4ee
4 changed files with 46 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
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.
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
29
gcc/testsuite/gcc.dg/tree-ssa/pr86263.c
Normal file
29
gcc/testsuite/gcc.dg/tree-ssa/pr86263.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* { 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);
|
||||
|
|
Loading…
Add table
Reference in a new issue