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 rtl-optimization/50191] Strange debug insn produced for TOC compiling 416.gamess with profile-generate


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50191

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gmail dot com

--- Comment #10 from Peter Bergner <bergner at gcc dot gnu.org> 2011-09-02 15:59:32 UTC ---
Adding Alan and a comment Alan made on some internal emails that hopefully will
shead some light on the subject:

After quite a lot of messing around, I managed to reproduce the linker
abort.  Turns out to be a .debug_loc reference into .toc!!

This
        .byte   0x3
        .8byte  .LC7
        .byte   0x6
        .byte   0x94
        .byte   0x4
        .byte   0xf7
        .uleb128 0x39
        .byte   0xf7
        .uleb128 0x32
        .byte   0x84
        .sleb128 32
        .byte   0xf6
        .byte   0x8
        .uleb128 0x32
        .byte   0x22
        .byte   0xf7
        .uleb128 0x39
        .byte   0xf7
        .uleb128 0
        .byte   0x9f

which is
    00000ec4 00000000000001f0 0000000000000250 (DW_OP_addr: 20;
DW_OP_deref; DW_OP_deref_size: 4; DW_OP_GNU_convert <0x39>; DW_OP_GN
U_convert <0x32>; DW_OP_breg20 (r20): 32; DW_OP_GNU_deref_type: 8 <0x32>;
DW_OP_plus; DW_OP_GNU_convert <0x39>; DW_OP_GNU_convert <0
x0>; DW_OP_stack_value)

The reference to .LC7 is the killer

.LC7:
        .tc ecp2_.P36000[TC],ecp2_+36000

Now the code using .LC7 looks like
        addis 10,2,.LC7@toc@ha
        .loc 1 416 0
        addi 11,1,1196
        ld 5,768(18)
        ld 9,.LC7@toc@l(10)
        mr 10,20
        .loc 1 305 0

so why on earth do we have such a weird location list?

(debug_insn 8123 8124 7848 5 (var_location:DI D#142 (mem/u/c:DI (lo_sum:DI
(debug_expr:DI D#146)
            (const:DI (unspec:DI [
                        (symbol_ref/u:DI ("*.LC7") [flags 0x2])
                    ] UNSPEC_TOCREL))) [23 S8 A8])) -1
     (nil))
(debug_insn 7848 8123 7852 5 (var_location:SI iznuc (fix:SI (plus:DF
(float:DF (mem:SI (debug_expr:DI D#142) [0 MEM[base: D.8528_3216, \
offset: 0B]+0 S4 A32]))
            (mem:DF (debug_expr:DI D#143) [0 MEM[base: D.8527_3225, offset:
0B]+0 S8 A64])))) chgpen.fppized.f:416 -1
     (nil))

Ick!


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