Commit 27c8b49b by Peter Bergner Committed by Peter Bergner

re PR middle-end/81564 (ICE in group_case_labels_stmt())

gcc/
	PR middle-end/81564
	* tree-cfg.c (group_case_labels_stmt): Handle already deleted blocks.

gcc/testsuite/
	PR middle-end/81564
	* gcc.dg/pr81564.c: New test.

From-SVN: r250628
parent b7675b59
2017-07-27 Peter Bergner <bergner@vnet.ibm.com>
PR middle-end/81564
* tree-cfg.c (group_case_labels_stmt): Handle already deleted blocks.
2017-07-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/81573
......
2017-07-27 Peter Bergner <bergner@vnet.ibm.com>
PR middle-end/81564
* gcc.dg/pr81564.c: New test.
2017-07-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/81573
......
/* PR middle-end/81564 ICE in group_case_labels_stmt(). */
/* { dg-do compile } */
/* { dg-options "-O2" } */
struct a {
int b;
int c;
};
void
foo (void)
{
struct a *e;
switch (e->c)
{
case 7:
case 3:
if (__builtin_expect(!0, 0))
__builtin_unreachable();
}
}
......@@ -1701,8 +1701,9 @@ group_case_labels_stmt (gswitch *stmt)
gcc_assert (base_case);
base_bb = label_to_block (CASE_LABEL (base_case));
/* Discard cases that have the same destination as the default case. */
if (base_bb == default_bb)
/* Discard cases that have the same destination as the default case or
whose destiniation blocks have already been removed as unreachable. */
if (base_bb == NULL || base_bb == default_bb)
{
i++;
continue;
......
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