From 36d579866680fd2b45800b072527a9cce93235d0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 9 Jun 2016 11:36:22 +0000 Subject: =?UTF-8?q?re=20PR=20tree-optimization/71462=20(gcc=20ICE=20at=20-?= =?UTF-8?q?O3=20=20on=20valid=20code=20on=20x86=5F64-linux-gnu=20with=20?= =?UTF-8?q?=E2=80=9Cseg=20fault=E2=80=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2016-06-09 Richard Biener PR tree-optimization/71462 * tree-ssa-loop-manip.c (find_uses_to_rename): Guard against removed blocks. * gcc.dg/torture/pr71462.c: New testcase. From-SVN: r237254 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr71462.c | 28 ++++++++++++++++++++++++++++ gcc/tree-ssa-loop-manip.c | 7 +++++-- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr71462.c (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3484047..134f224 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-09 Richard Biener + + PR tree-optimization/71462 + * tree-ssa-loop-manip.c (find_uses_to_rename): Guard against + removed blocks. + 2016-06-09 Martin Liska * predict.c (filter_predictions): New function. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 844f0f5..8ee01b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-09 Richard Biener + + PR tree-optimization/71462 + * gcc.dg/torture/pr71462.c: New testcase. + 2016-06-09 Marek Polacek PR c/65471 diff --git a/gcc/testsuite/gcc.dg/torture/pr71462.c b/gcc/testsuite/gcc.dg/torture/pr71462.c new file mode 100644 index 0000000..390b886 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr71462.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ + +short a; +long b; +void fn1() +{ + int c = a = 1; + for (; a; a++) + { + for (; 9 <= 8;) + for (;;) { + a = 20; + for (; a <= 35; a++) + ; +line:; + } + if ((c += 264487869) == 9) + { + unsigned *d = 0; + for (; b;) + d = (unsigned *)&c; + if (d) + for (;;) + ; + } + } + goto line; +} diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index 77c5eb4..e87d290 100644 --- a/gcc/tree-ssa-loop-manip.c +++ b/gcc/tree-ssa-loop-manip.c @@ -472,8 +472,11 @@ find_uses_to_rename (bitmap changed_bbs, bitmap *use_blocks, bitmap need_phis, if (changed_bbs) EXECUTE_IF_SET_IN_BITMAP (changed_bbs, 0, index, bi) - find_uses_to_rename_bb (BASIC_BLOCK_FOR_FN (cfun, index), use_blocks, - need_phis, use_flags); + { + bb = BASIC_BLOCK_FOR_FN (cfun, index); + if (bb) + find_uses_to_rename_bb (bb, use_blocks, need_phis, use_flags); + } else FOR_EACH_BB_FN (bb, cfun) find_uses_to_rename_bb (bb, use_blocks, need_phis, use_flags); -- cgit v1.1