From: Rong Xu Date: Fri, 14 Nov 2014 00:30:31 +0000 (+0000) Subject: re PR debug/63581 (undefined references in debug_info) X-Git-Tag: upstream/12.2.0~58976 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fb3402f691447225a17f83d1ef168eb71a25ce0;p=platform%2Fupstream%2Fgcc.git re PR debug/63581 (undefined references in debug_info) 2014-11-13 Rong Xu gcc: PR debug/63581 * cfgrtl.c (emit_barrier_after_bb): Append the barrier to the footer, instead of unconditionally overwritten gcc/testsuite: PR debug/63581 * g++.dg/tree-prof/pr63581.C: New test. From-SVN: r217530 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 98d5668..ff92bb2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-13 Rong Xu + + PR debug/63581 + * cfgrtl.c (emit_barrier_after_bb): Append the barrier to the + footer, instead of unconditionally overwritten. + 2014-11-14 Martin Jambor * cgraph.h (clear_outer_type): Make public. Fix comment. @@ -6399,6 +6405,7 @@ (lds_fpscr, sts_fpscr): New insns. (toggle_sz, toggle_pr): Use SImode for FPSCR_REG instead of PSImode. +>>>>>>> .r217525 2014-10-17 Eric Botcazou * ipa-inline-transform.c (master_clone_with_noninline_clones_p): New. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index f6eb207..42d21d7 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1461,7 +1461,24 @@ emit_barrier_after_bb (basic_block bb) gcc_assert (current_ir_type () == IR_RTL_CFGRTL || current_ir_type () == IR_RTL_CFGLAYOUT); if (current_ir_type () == IR_RTL_CFGLAYOUT) - BB_FOOTER (bb) = unlink_insn_chain (barrier, barrier); + { + rtx_insn *insn = unlink_insn_chain (barrier, barrier); + + if (BB_FOOTER (bb)) + { + rtx_insn *footer_tail = BB_FOOTER (bb); + + while (NEXT_INSN (footer_tail)) + footer_tail = NEXT_INSN (footer_tail); + if (!BARRIER_P (footer_tail)) + { + SET_NEXT_INSN (footer_tail) = insn; + SET_PREV_INSN (insn) = footer_tail; + } + } + else + BB_FOOTER (bb) = insn; + } } /* Like force_nonfallthru below, but additionally performs redirection diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bd2c51a..c61744b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-13 Rong Xu + + PR debug/63581 + * g++.dg/tree-prof/pr63581.C: New test. + 2014-11-13 Teresa Johnson PR tree-optimization/63841 @@ -3153,6 +3158,7 @@ * gcc.dg/attr-isr.c: Move SH specific test to ... * gcc.target/sh/attr-isr.c: ... here. +>>>>>>> .r217525 2014-10-17 Marek Polacek PR c/63567 diff --git a/gcc/testsuite/g++.dg/tree-prof/pr63581.C b/gcc/testsuite/g++.dg/tree-prof/pr63581.C new file mode 100644 index 0000000..c8caf07 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-prof/pr63581.C @@ -0,0 +1,91 @@ +// { dg-require-effective-target freorder } +/* { dg-options "-O2 -g -fno-peel-loops" } */ + +struct page { + int i; +} global; + +__attribute__((noinline)) static struct page* find_page1 (int i) +{ + if ( i< 150) + return 0; + global.i = i; + return &global; +} + +__attribute__((noinline)) static struct page* find_page2 (int i) +{ + global.i = i; + return &global; +} + +volatile int ii; +__attribute__((noinline)) static int zero (void) +{ + return ii; +} + +static inline int uptodate (struct page* p) +{ + return (p->i < 709); +} + +static struct page* bar(int i) +{ + struct page *page; + +repeat: + page = find_page1 (i); + if (!page) { + page = find_page2 (i); + if (!page) + return 0; + if (zero () ) { + zero (); + goto repeat; + } + } + return page; +} + +__attribute__((noinline)) int foo (int n) +{ + struct page *page; + +retry: + page = bar (n); + if (page == 0) + return 0; + if (uptodate (page)) + goto out; + + zero (); + if (page->i < 0) { + zero (); + goto retry; + } +out: + return 1; +} + +__attribute__((noinline)) int hot (void) +{ + int i; + int sum = 0; + + for (i = 0; i < 433038; i++) + sum+=i; + + return sum; +} + +int main(void) +{ + int i; + + global.i = hot (); + for (i = 0; i < 858; i++) + foo (i); + + return 0; +}