diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-01-27 10:19:30 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-01-27 10:19:30 +0100 |
commit | 6d71672db616f6d3f5462028d6476a28610f42b5 (patch) | |
tree | 348fce1e9f815dcfda4c8411fae30e1f49b30857 /gcc | |
parent | 3dd598be88193ee087ab51312b5e464b2d6e2891 (diff) | |
download | gcc-6d71672db616f6d3f5462028d6476a28610f42b5.zip gcc-6d71672db616f6d3f5462028d6476a28610f42b5.tar.gz gcc-6d71672db616f6d3f5462028d6476a28610f42b5.tar.bz2 |
re PR rtl-optimization/61058 (ICE: RTL check: expected elt 3 type 'B', have '0' (rtx barrier) in distance_agu_use_in_bb, at config/i386/i386.c:16740 with __builtin_unreachable())
PR rtl-optimization/61058
* jump.c (cleanup_barriers): Update basic block boundaries
if BLOCK_FOR_INSN is non-NULL on PREV.
* gcc.dg/pr61058.c: New test.
From-SVN: r220155
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/jump.c | 25 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr61058.c | 10 |
4 files changed, 45 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5597e32..57f5efe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-01-27 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/61058 + * jump.c (cleanup_barriers): Update basic block boundaries + if BLOCK_FOR_INSN is non-NULL on PREV. + 2015-01-27 Ilya Enkovich <ilya.enkovich@intel.com> * tree-chkp.c (chkp_call_returns_bounds_p): Fix handling of @@ -168,7 +168,30 @@ cleanup_barriers (void) if (BARRIER_P (prev)) delete_insn (insn); else if (prev != PREV_INSN (insn)) - reorder_insns_nobb (insn, insn, prev); + { + basic_block bb = BLOCK_FOR_INSN (prev); + rtx_insn *end = PREV_INSN (insn); + reorder_insns_nobb (insn, insn, prev); + if (bb) + { + /* If the backend called in machine reorg compute_bb_for_insn + and didn't free_bb_for_insn again, preserve basic block + boundaries. Move the end of basic block to PREV since + it is followed by a barrier now, and clear BLOCK_FOR_INSN + on the following notes. + ??? Maybe the proper solution for the targets that have + cfg around after machine reorg is not to run cleanup_barriers + pass at all. */ + BB_END (bb) = prev; + do + { + prev = NEXT_INSN (prev); + if (prev != insn && BLOCK_FOR_INSN (prev) == bb) + BLOCK_FOR_INSN (prev) = NULL; + } + while (prev != end); + } + } } } return 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0686fa7..8bcb32a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-27 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/61058 + * gcc.dg/pr61058.c: New test. + 2015-01-27 Ilya Enkovich <ilya.enkovich@intel.com> * gcc.target/i386/chkp-narrow-bounds.c: New. diff --git a/gcc/testsuite/gcc.dg/pr61058.c b/gcc/testsuite/gcc.dg/pr61058.c new file mode 100644 index 0000000..6f840f4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr61058.c @@ -0,0 +1,10 @@ +/* PR rtl-optimization/61058 */ +/* { dg-do compile } */ +/* { dg-options "" } */ +/* { dg-additional-options "-fno-asynchronous-unwind-tables -mtune=atom" { target i?86-*-* x86_64-*-* } } */ + +void +foo (void) +{ + __builtin_unreachable (); +} |