------- Comment #3 from jakub at gcc dot gnu dot org 2010-01-26 12:14 ------- Note the http://gcc.gnu.org/ml/gcc-patches/2010-01/msg01282.html doesn't bootstrap on the redhat/gcc-4_4-branch on ppc, while it bootstraps on the trunk on x86_64-linux and i686-linux and on the branch on those arches too. I will try to bootstrap trunk with that patch on ppc soon to see. Anyway, the bootstrap problem can be simplified to: typedef struct { char **b; int c[]; } T; int a; extern int d[], e; extern char f[30];
static void foo (unsigned *x, unsigned *y, int z) { int i; for (i = 0; i < z; i++) x[i] = y[i / 2]; } void bar (T *y) { unsigned x[4]; foo (x, (unsigned *) d, e); __builtin_memcpy (y->b [y->c[0]], f, a); } at -O2 -g -m64 this doesn't assemble, as .debug_loc contains: .LLST3: .8byte .LVL1-.Ltext0 # Location list begin address (*.LLST3) .8byte .LVL7-.Ltext0 # Location list end address (*.LLST3) .2byte 0x1 # Location expression size .byte 0x59 # DW_OP_reg9 .8byte .LVL7-.Ltext0 # Location list begin address (*.LLST3) .8byte .LVL9-1-.Ltext0 # Location list end address (*.LLST3) .2byte 0xc # Location expression size .byte 0x72 # DW_OP_breg2 .byte 0x0 # sleb128 0 .byte 0x3 # DW_OP_addr .8byte ....@toc .byte 0x22 # DW_OP_plus .8byte 0x0 # Location list terminator begin (*.LLST3) .8byte 0x0 # Location list terminator end (*.LLST3) and @toc isn't allowed in .8byte. There is: (insn 41 43 40 2 random.i:18 (set (reg/f:DI 9 9 [orig:148 d.0 ] [148]) (mem/u/c:DI (plus:DI (reg:DI 2 2) (const:DI (unspec:DI [ (symbol_ref/u:DI ("*.LC2") [flags 0x2]) ] 49))) [7 S8 A8])) 350 {*movdi_internal64} (expr_list:REG_DEAD (reg:DI 2 2) (expr_list:REG_EQUIV (symbol_ref:DI ("d") [flags 0xc0] <var_decl 0x7fdb7e28de60 d>) (nil)))) ... (debug_insn 47 46 48 2 random.i:18 (var_location:DI y (reg/f:DI 9 9 [orig:148 d.0 ] [148])) -1 (nil)) before var-tracking and apparently var-tracking doesn't consider that REG_EQUIV, which leads to: (note 142 75 89 5 (var_location y (expr_list:REG_DEP_TRUE (mem/u/c:DI (plus:DI (reg:DI 2 2) (const:DI (unspec:DI [ (symbol_ref/u:DI ("*.LC2") [flags 0x2]) ] 49))) [7 S8 A8]) (const_int 0 [0x0]))) NOTE_INSN_VAR_LOCATION) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42861