This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Scale DW_CFA_advance_loc[124] output values
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: binutils at sourceware dot org
- Date: Tue, 18 Nov 2008 09:53:12 -0500 (EST)
- Subject: [PATCH] Scale DW_CFA_advance_loc[124] output values
The enclosed patch fixes GCC PR target/37610. This was noticed
on hppa-unknown-linux-gnu because DWARF2_LINE_MIN_INSN_LENGTH is
defined to 4 in tc-hppa.h. This resulted incorrect advances being
computed in the unwind process, resulting in the failure of the
g++.dg/eh/pr29166.C execution test.
A fix to GCC is also needed to detect buggy assembler versions.
Tested on hppa-unknown-linux-gnu. Ok?
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2008-11-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* dw2gencfi.c (output_cfi_insn): Scale DW_CFA_advance_loc1,
DW_CFA_advance_loc2 and DW_CFA_advance_loc4 outputs.
Index: dw2gencfi.c
===================================================================
RCS file: /cvs/src/src/gas/dw2gencfi.c,v
retrieving revision 1.39
diff -u -3 -p -r1.39 dw2gencfi.c
--- dw2gencfi.c 9 Oct 2008 17:31:43 -0000 1.39
+++ dw2gencfi.c 18 Nov 2008 02:50:24 -0000
@@ -972,20 +972,20 @@ output_cfi_insn (struct cfi_insn_data *i
if (scaled <= 0x3F)
out_one (DW_CFA_advance_loc + scaled);
- else if (delta <= 0xFF)
+ else if (scaled <= 0xFF)
{
out_one (DW_CFA_advance_loc1);
- out_one (delta);
+ out_one (scaled);
}
- else if (delta <= 0xFFFF)
+ else if (scaled <= 0xFFFF)
{
out_one (DW_CFA_advance_loc2);
- out_two (delta);
+ out_two (scaled);
}
else
{
out_one (DW_CFA_advance_loc4);
- out_four (delta);
+ out_four (scaled);
}
}
else