This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/67043] New: [6 Regression] -fcompare-debug failure with -O3


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67043

            Bug ID: 67043
           Summary: [6 Regression] -fcompare-debug failure with -O3
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

% cat test.i
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();
  }
}

 % gcc --save-temps -fcompare-debug -O3 -w -c test.i
gcc: error: test.i: -fcompare-debug failure

 % diff -u test.gkd test.gk.gkd
--- test.gkd    2015-07-28 12:25:03.890035508 +0200
+++ test.gk.gkd 2015-07-28 12:25:03.926034824 +0200
@@ -220,10 +220,10 @@
 (code_label # 0 0 5 9 "" [2 uses])
 (note # 0 0 [bb 5] NOTE_INSN_BASIC_BLOCK)
 (insn:TI # 0 0 5 (set (mem/f/c:DI (symbol_ref:DI ("a") [flags 0x2]  <var_decl
# a>) [ a+0 S8 A64])
-        (reg:DI 3 bx [94])) test.i:19# {*movdi_internal}
+        (reg:DI 3 bx [95])) test.i:19# {*movdi_internal}
      (nil))
 (insn # 0 0 5 (set (reg/f:DI 6 bp [orig:91 D.xxxx ] [91])
-        (reg:DI 3 bx [94])) test.i:20# {*movdi_internal}
+        (reg:DI 3 bx [95])) test.i:20# {*movdi_internal}
      (nil))
 (call_insn:TI # 0 0 5 (call (mem:QI (symbol_ref:DI ("rt_mutex_owner") [flags
0x41]  <function_decl # rt_mutex_owner>) [ rt_mutex_owner S1 A8])
         (const_int 0 [0])) test.i:8# {*call}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]