re PR tree-optimization/53881 (ICE in hoist_edge_and_branch_if_true)

gcc/
	PR tree-optimization/53881
	* tree-switch-conversion.c (emit_case_bit_tests): Do not rely on
	comparing labels to establish uniqueness of a switch case target,
	use the CFG instead.

testsuite/
	PR tree-optimization/53881
	* gcc.dg/pr53881.c: New test.

From-SVN: r189349
This commit is contained in:
Steven Bosscher 2012-07-07 12:35:44 +00:00
parent f99391fe45
commit 8166ff4df0
4 changed files with 36 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2012-07-07 Steven Bosscher <steven@gcc.gnu.org>
PR tree-optimization/53881
* tree-switch-conversion.c (emit_case_bit_tests): Do not rely on
comparing labels to establish uniqueness of a switch case target,
use the CFG instead.
2012-07-07 Ulrich Weigand <ulrich.weigand@linaro.org>
* combine.c (force_to_mode) [LSHIFTRT]: Avoid undefined behaviour

View File

@ -1,3 +1,8 @@
2012-07-07 Steven Bosscher <steven@gcc.gnu.org>
PR tree-optimization/53881
* gcc.dg/pr53881.c: New test.
2012-07-06 Jason Merrill <jason@redhat.com>
PR c++/53862

View File

@ -0,0 +1,22 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
int a, b;
void
fn1 ()
{
int c;
switch (a)
{
case 8:
c = 0;
goto Label;
case 0:
case 1:
Label:
break;
default:
b = 0;
}
}

View File

@ -329,14 +329,13 @@ emit_case_bit_tests (gimple swtch, tree index_expr,
unsigned int lo, hi;
tree cs = gimple_switch_label (swtch, i);
tree label = CASE_LABEL (cs);
edge e = find_edge (switch_bb, label_to_block (label));
for (k = 0; k < count; k++)
if (label == test[k].label)
if (e == test[k].target_edge)
break;
if (k == count)
{
edge e = find_edge (switch_bb, label_to_block (label));
gcc_assert (e);
gcc_checking_assert (count < MAX_CASE_BIT_TESTS);
test[k].hi = 0;
test[k].lo = 0;