This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
eh frame debug size improvement
- To: egcs at cygnus dot com
- Subject: eh frame debug size improvement
- From: Richard Henderson <rth at cygnus dot com>
- Date: Wed, 15 Oct 1997 02:34:21 -0700
- Reply-To: Richard Henderson <rth at cygnus dot com>
With the following minimal patch, I get a 5 to 6 fold reduction in
.eh_frame on i686. It is beginning to approach acceptible.
I have one idea to get things a bit smaller using only the tools
at hand: we need one CFA instruction to describe something akin
to m68k movem, in which a bit mask of registers is saved at
consecutive locations. The fact that x86 has no such insn is
irrelevant. If the prologue is in one block (some relaxation of
the rule is possible), then we can consider all of the CFA insns
to occur at the same point. This is important considering the
rather large penalty we incur with the current tools by moving
the CFA loc.
Judging from the sparc port, which does effectively this via its
window_save CFA op, we can potentially get another 2 fold reduction.
Unfortunately, the only way to get beyond this is adding smarts
to gnu ld to combine CIE's from across object files, and to recode
CFA instruction blocks now that the absolute distances are known.
r~
Sizes of text and frame unwind sizes and ratios for several
configurations. Following proper statistical practice, the programs
listed were of course chosen at random and can therefore be expected
to be representative of their class. ;-)
i686, base egcs
genattr
.text 10860
.eh_frame 5500 50.6%
cpp
.text 61852
.eh_frame 25428 41.1%
f771
.text 1532420
.eh_frame 944176 61.6%
sparc, base egcs
genattr
.text 12616
.eh_frame 1092 8.65%
cpp
.text 74820
.eh_frame 3960 5.29%
f771
.text 2025500
.eh_frame 110756 5.47%
i686, with patch
genattr
.text 10860
.eh_frame 1988 18.3%
cpp
.text 61852
.eh_frame 7060 11.4%
f771
.text 1532476
.eh_frame 191700 12.5%
Wed Oct 15 02:09:44 1997 Richard Henderson <rth@cygnus.com>
* dwarf2out.c (dwarf2out_stack_adjust): Skip if frame_pointer_needed.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/cvsfiles/egcs/gcc/dwarf2out.c,v
retrieving revision 1.13
diff -u -p -d -r1.13 dwarf2out.c
--- dwarf2out.c 1997/10/07 21:35:54 1.13
+++ dwarf2out.c 1997/10/15 09:00:27
@@ -992,6 +992,14 @@ dwarf2out_stack_adjust (insn)
long offset;
char *label;
+ /* If this function uses a frame pointer, we know a-priori the frame
+ size does not vary. If we don't have EH regions, we can unwind
+ the function with just the normal prologue info; if we do, we can
+ either reinit the stack pointer off of the frame pointer, or leave
+ it alone if EXIT_IGNORE_STACK. */
+ if (frame_pointer_needed)
+ return;
+
if (GET_CODE (insn) == BARRIER)
{
/* When we see a BARRIER, we know to reset args_size to 0. Usually