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

            Bug ID: 61923
           Summary: [4.8/4.9/4.10 Regression] -fcompare-debug errors while
                    building Linux kernel.
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

Building the Linux kernel with "GCC_COMPARE_DEBUG=1 make" hits several 
failures.

markus@x4 tmp % cat inode.i
typedef struct
{
  struct
  {
    struct
    {
      char head;
    } tickets;
  };
} arch_spinlock_t;
struct ext4_map_blocks
{
  int m_lblk;
  int m_len;
  int m_flags;
};
int ext4_da_map_blocks_ei_0;
void fn1 (int p1, struct ext4_map_blocks *p2)
{
  int ret;
  if (p2->m_flags)
    {
      ext4_da_map_blocks_ei_0++;
      arch_spinlock_t *lock;
      switch (sizeof *&lock->tickets.head)
      case 1:
      asm("" : "+m"(*&lock->tickets.head) : ""(0));
      __asm__("");
      ret = 0;
    }
  fn2 (p2->m_lblk, p2->m_len);
}

markus@x4 tmp % gcc -c -O2 -fcompare-debug inode.i --save-temps
gcc: error: inode.i: -fcompare-debug failure (length)

markus@x4 tmp % diff -u inode.gkd inode.gk.gkd
--- inode.gkd   2014-07-26 22:01:20.578062879 +0200
+++ inode.gk.gkd        2014-07-26 22:01:20.598062450 +0200
@@ -82,7 +82,7 @@
      (expr_list:REG_EQUIV (mem:SI (plus:DI (reg/v/f:DI 0 ax [orig:90 p2 ]
[90])
                 (const_int 4 [0x4])) [ p2_3(D)->m_len+0 S4 A32])
         (nil)))
-(insn:TI# 0 0 4 (set (reg:SI 5 di)
+(insn# 0 0 4 (set (reg:SI 5 di)
         (mem:SI (reg/v/f:DI 0 ax [orig:90 p2 ] [90]) [ p2_3(D)->m_lblk+0 S4
A32])) inode.i:31# {*movsi_internal}
      (expr_list:REG_DEAD (reg/v/f:DI 0 ax [orig:90 p2 ] [90])
         (nil)))

Reply via email to