From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12077 invoked by alias); 23 Aug 2008 20:12:58 -0000 Received: (qmail 12057 invoked by uid 22791); 23 Aug 2008 20:12:58 -0000 X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 23 Aug 2008 20:12:22 +0000 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id 5B05B431A; Sat, 23 Aug 2008 16:12:18 -0400 (EDT) Subject: Re: update dwarf2 asm unwind info [hppa64-*-* failures] To: dave@hiauly1.hia.nrc.ca (John David Anglin) Date: Sat, 23 Aug 2008 21:14:00 -0000 From: "John David Anglin" Cc: rth@twiddle.net, sje@cup.hp.com, gcc-patches@gcc.gnu.org, dave.anglin@nrc-cnrc.gc.ca, binutils-patches@gcc.gnu.org In-Reply-To: <20080823185740.940D74E77@hiauly1.hia.nrc.ca> from "John David Anglin" at Aug 23, 2008 02:57:39 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20080823201219.5B05B431A@hiauly1.hia.nrc.ca> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg01767.txt.bz2 > @@ -57,39 +57,39 @@ > > 000000c8 00000018 000000cc FDE cie=00000000 pc=000000a8..000000d8 > DW_CFA_advance_loc: 8 to 000000b0 > - DW_CFA_def_cfa_offset_sf: -64 > + DW_CFA_def_cfa_offset_sf: -16 > + DW_CFA_advance_loc: 20 to 000000c4 > DW_CFA_offset: r4 at cfa+0 > DW_CFA_offset_extended_sf: r2 at cfa-20 > DW_CFA_nop > DW_CFA_nop > - DW_CFA_nop > > 000000e4 00000018 000000e8 FDE cie=00000000 pc=000000d8..00000144 > DW_CFA_advance_loc: 12 to 000000e4 > - DW_CFA_def_cfa_offset_sf: -64 > + DW_CFA_def_cfa_offset_sf: -16 > > The first difference is the code alignment factor. It seems this > is hard-coded to 1 in dwarf2out.c. > > It looks like the offset of -16 is wrong: > > .cfi_startproc > _Unwind_DeleteException: > .PROC > .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3 > .ENTRY > stw %r2,-20(%r30) > stwm %r4,64(%r30) > .cfi_def_cfa_offset -16 Comparatively, with -fno-dwarf2-asm, the .eh_frame output is .byte 0x13 .sleb128 -16 So, both bits of code output an "offset" of -16. It seems gas doesn't have a .cfi_def_cfa_offset_sf directive, yet the ".cfi_def_cfa_offset -16" encodes the value with DW_CFA_def_cfa_offset_sf when the value is negative. I see the following code in dw2gencfi.c: case DW_CFA_def_cfa_offset: offset = insn->u.i; if (offset < 0) { out_one (DW_CFA_def_cfa_offset_sf); out_sleb128 (offset / DWARF2_CIE_DATA_ALIGNMENT); } else { out_one (DW_CFA_def_cfa_offset); out_uleb128 (offset); } As can be seen, gas is dividing DWARF2_CIE_DATA_ALIGNMENT when the offset is negative. GCC is also dividing by the data alignment. So, which is wrong? Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602)