diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-12-14 12:02:37 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-12-14 12:02:37 +0100 |
commit | 6dfb83e8d8625c1845a3df51e5519d7904700add (patch) | |
tree | 8b6055274e6c1b7e00d999b5bdc0829c5665ba9c /gcc | |
parent | aa215959c5f6c6ec2e877d976f305eb8c9e08f2c (diff) | |
download | gcc-6dfb83e8d8625c1845a3df51e5519d7904700add.zip gcc-6dfb83e8d8625c1845a3df51e5519d7904700add.tar.gz gcc-6dfb83e8d8625c1845a3df51e5519d7904700add.tar.bz2 |
re PR bootstrap/83396 (Bootstrap failures with Statement Frontiers)
PR bootstrap/83396
* var-tracking.c (vt_initialize): Ignore non-DEBUG_INSNs outside of
basic blocks. Assert debug bind insns don't appear outside of bbs,
don't reset them. Assert insns without BLOCK_FOR_INSN are outside of
bb. Simplify.
* gcc.dg/pr83396.c: New test.
From-SVN: r255627
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr83396.c | 12 | ||||
-rw-r--r-- | gcc/var-tracking.c | 28 |
4 files changed, 38 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f4b61eb..504b331 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2017-12-14 Jakub Jelinek <jakub@redhat.com> + PR bootstrap/83396 + * var-tracking.c (vt_initialize): Ignore non-DEBUG_INSNs outside of + basic blocks. Assert debug bind insns don't appear outside of bbs, + don't reset them. Assert insns without BLOCK_FOR_INSN are outside of + bb. Simplify. + PR tree-optimization/83198 * gimple-ssa-sprintf.c (format_floating): Set type solely based on dir.modifier, regardless of TREE_TYPE (arg). Assume non-REAL_CST diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 939e4a9..ff37479 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-12-14 Jakub Jelinek <jakub@redhat.com> + PR bootstrap/83396 + * gcc.dg/pr83396.c: New test. + PR tree-optimization/83198 * gcc.dg/pr83198.c: New test. * gcc.dg/tree-ssa/pr83198.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr83396.c b/gcc/testsuite/gcc.dg/pr83396.c new file mode 100644 index 0000000..7d8220e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr83396.c @@ -0,0 +1,12 @@ +/* PR bootstrap/83396 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ + +int bar (int); +int baz (int); + +int +foo (int x) +{ + return bar (x) || baz (x) != 0; +} diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 8e500b1..b556e79 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -10157,25 +10157,31 @@ vt_initialize (void) insns that might be before it too. Unfortunately, BB_HEADER and BB_FOOTER are not set while we run this pass. */ - insn = get_first_insn (bb); - for (rtx_insn *next; - insn != BB_HEAD (bb->next_bb) - ? next = NEXT_INSN (insn), true : false; + rtx_insn *next; + bool outside_bb = true; + for (insn = get_first_insn (bb); insn != BB_HEAD (bb->next_bb); insn = next) { + if (insn == BB_HEAD (bb)) + outside_bb = false; + else if (insn == NEXT_INSN (BB_END (bb))) + outside_bb = true; + next = NEXT_INSN (insn); if (INSN_P (insn)) { + if (outside_bb) + { + /* Ignore non-debug insns outside of basic blocks. */ + if (!DEBUG_INSN_P (insn)) + continue; + /* Debug binds shouldn't appear outside of bbs. */ + gcc_assert (!DEBUG_BIND_INSN_P (insn)); + } basic_block save_bb = BLOCK_FOR_INSN (insn); if (!BLOCK_FOR_INSN (insn)) { + gcc_assert (outside_bb); BLOCK_FOR_INSN (insn) = bb; - gcc_assert (DEBUG_INSN_P (insn)); - /* Reset debug insns between basic blocks. - Their location is not reliable, because they - were probably not maintained up to date. */ - if (DEBUG_BIND_INSN_P (insn)) - INSN_VAR_LOCATION_LOC (insn) - = gen_rtx_UNKNOWN_VAR_LOC (); } else gcc_assert (BLOCK_FOR_INSN (insn) == bb); |