From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9964 invoked by alias); 21 Sep 2006 13:40:45 -0000 Received: (qmail 9920 invoked by uid 48); 21 Sep 2006 13:40:38 -0000 Date: Thu, 21 Sep 2006 13:40:00 -0000 Message-ID: <20060921134038.9919.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/29166] broken unwind information for many life variables resulting in register corruption In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "matz at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-09/txt/msg02044.txt.bz2 List-Id: ------- Comment #3 from matz at gcc dot gnu dot org 2006-09-21 13:40 ------- Hmpf. I wonder if there's any tool to really inspect the unwind info, like it is possible for dwarf. But readelf doesn't help very much: % readelf -wf a.out % readelf -u a.out ... <_Z4doItv>: [0x4000000000000b00-0x4000000000003ce0], info at +0x87b0 v1, flags=0x0 (), len=40 bytes R2:prologue_gr(mask=[psp],grsave=r119,rlen=49) P5:frgr_mem(grmask=[r4,r5,r6,r7],frmask=[f2,f3,f4,f5,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30,f31]) P4:spill_mask(imask=[---,---,---,---,rr-,rr-,-f-,ff-,ff-,ff-,ff-,ff-,ff-,ff-,ff-,ff-,f]) P7:mem_stack_v(t=3) P7:unat_when(t=7) P7:unat_psprel(pspoff=0x10-0x180) P7:pfs_when(t=9) P7:pfs_psprel(pspoff=0x10-0x178) P7:rp_when(t=18) P7:rp_psprel(pspoff=0x10-0x148) R3:body(rlen=2345) R1:prologue(rlen=0) R1:prologue(rlen=0) <_Z4testv>: [0x4000000000003ce0-0x4000000000003db0], info at +0x87e0 v1, flags=0x3 ( ehandler uhandler), len=16 bytes R2:prologue_gr(mask=[rp,ar.pfs,psp],grsave=r32,rlen=5) P7:pfs_when(t=0) P7:mem_stack_v(t=1) P7:rp_when(t=4) R3:body(rlen=34) B2:epilogue(t=2,ecount=0) R1:prologue(rlen=0) R1:prologue(rlen=0) R1:prologue(rlen=0) I traced the things in libunwind a bit, and know that the one writing the wrong location of R4-7 into context->loc is the IA64_INSN_ADD_PSP_NAT unwind script instruction, interpreted in _ULia64_find_save_locs (in run_script actually). And it happens while context still is set to the doIt() function. But I have no idea, how that script is generated, or how it relates to the assembler file. For instance, the start of doIt() has this code: .save.g 0x1 .mem.offset 344, 0 // st8.spill [r18] = r4, 16 //, ;; .save.g 0x2 .mem.offset 336, 0 // st8.spill [r17] = r5, 16 //, .save.g 0x4 .mem.offset 328, 0 // st8.spill [r18] = r6, 16 //, ;; .save.g 0x8 .mem.offset 320, 0 // st8.spill [r17] = r7, 16 //, I assume (because there are no explicit unwind sections in the assembler source) that these .save.g and .mem.offset somehow are pseudo instructions which somehow produce unwind info. But I'm at a loss here. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29166