From: Thomas Preud'homme Date: Tue, 4 Aug 2015 02:11:58 +0000 (+0000) Subject: re PR debug/67043 (-fcompare-debug failure with -O3) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43d56ad78ddc903e61abeaa2efaff2efa2de941d;p=gcc.git re PR debug/67043 (-fcompare-debug failure with -O3) 2015-08-04 Thomas Preud'homme gcc/ PR tree-optimization/67043 * loop-invariant.c (move_invariant_reg): Recompute luids in loop preheader after hoisting invariant in it. (find_defs): Force recomputation of all luids. gcc/testsuite/ PR tree-optimization/67043 * gcc.dg/pr67043.c: New test. From-SVN: r226540 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb4a60400b5..acb75e80ae0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-08-04 Thomas Preud'homme + + PR tree-optimization/67043 + * loop-invariant.c (move_invariant_reg): Recompute luids in loop + preheader after hoisting invariant in it. + (find_defs): Force recomputation of all luids. + 2015-08-03 Peter Bergner * config/rs6000/htm.md (tabort.): Restrict the source operand to diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index 1fdb84d8d69..52c8ae857c1 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -676,6 +676,8 @@ find_defs (struct loop *loop) df_remove_problem (df_chain); df_process_deferred_rescans (); df_chain_add_problem (DF_UD_CHAIN); + df_live_add_problem (); + df_live_set_all_dirty (); df_set_flags (DF_RD_PRUNE_DEAD_DEFS); df_analyze_loop (loop); check_invariant_table_size (); @@ -1629,6 +1631,7 @@ move_invariant_reg (struct loop *loop, unsigned invno) fprintf (dump_file, "Invariant %d moved without introducing a new " "temporary register\n", invno); reorder_insns (inv->insn, inv->insn, BB_END (preheader)); + df_recompute_luids (preheader); /* If there is a REG_EQUAL note on the insn we just moved, and the insn is in a basic block that is not always executed or the note diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f34d9fd014d..ae404d30409 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-08-04 Thomas Preud'homme + + PR tree-optimization/67043 + * gcc.dg/pr67043.c: New test. + 2015-08-03 Peter Bergner * gcc.target/powerpc/htm-tabort-no-r0.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr67043.c b/gcc/testsuite/gcc.dg/pr67043.c new file mode 100644 index 00000000000..36aa68673f1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr67043.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fcompare-debug -w" } */ + +extern void rt_mutex_owner (void); +extern void rt_mutex_deadlock_account_lock (int); +extern void signal_pending (void); +__typeof__ (int *) a; +int b; + +int +try_to_take_rt_mutex (int p1) { + rt_mutex_owner (); + if (b) + return 0; + rt_mutex_deadlock_account_lock (p1); + return 1; +} + +void +__rt_mutex_slowlock (int p1) { + int c; + for (;;) { + c = ({ + asm ("" : "=r"(a)); + a; + }); + if (try_to_take_rt_mutex (c)) + break; + if (__builtin_expect (p1 == 0, 0)) + signal_pending (); + } +}