public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] MIPS: A small optimization for dwarf2 frame data.
@ 2008-02-26  5:26 David Daney
  2008-02-26 17:37 ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: David Daney @ 2008-02-26  5:26 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

The dwarf frame data produced for most mips targets contains workarounds
for bugs in SGI's debugger and other tools.  For GNU/Linux based mips
systems, these are not needed.

This patch undefs the MIPS_DEBUGGING_INFO for linux systems (as is
already done for sde and vxworks) so that the workarounds are not used. 
I had opened an enhancement PR target/34409 to track the issue.  The
main thing the patch does is to enable the generation of
DW_CFA_def_cfa_register codes in the dwarf2 frame data.  This is 1 - 2
bytes shorter than the DW_CFA_def_cfa that it replaces.

The end result is that the size of the .debug_frame section in
libstdc++.so is reduced by 76 bytes out of 66124 (a whopping 0.1%).  In
theory there can be space savings in the .eh_frame section as well, but
because the fde records are 4 byte aligned, there is no actual savings
in libstdc++.so as the savings was padded away.

Tested on mipsel-linux with all default languages and the gdb testsuite
with no regressions.

OK to commit?

2008-02-25  David Daney  <ddaney@avtrex.com>

    PR target/34409
    * config/mips/linux.h: Undef MIPS_DEBUGGING_INFO.



[-- Attachment #2: mips-debugging.diff --]
[-- Type: text/x-patch, Size: 409 bytes --]

Index: gcc/config/mips/linux.h
===================================================================
--- gcc/config/mips/linux.h	(revision 132166)
+++ gcc/config/mips/linux.h	(working copy)
@@ -149,3 +149,8 @@ along with GCC; see the file COPYING3.  
 #else
 #define NO_SHARED_SPECS
 #endif
+
+/* GNU/Linux systems don't require the SGI debugging information
+   work-arounds.  */
+#undef MIPS_DEBUGGING_INFO
+

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] MIPS: A small optimization for dwarf2 frame data.
  2008-02-26  5:26 [Patch] MIPS: A small optimization for dwarf2 frame data David Daney
@ 2008-02-26 17:37 ` Richard Sandiford
  2008-02-26 17:43   ` David Daney
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Sandiford @ 2008-02-26 17:37 UTC (permalink / raw)
  To: David Daney; +Cc: gcc-patches

David Daney <ddaney@avtrex.com> writes:
> The dwarf frame data produced for most mips targets contains workarounds
> for bugs in SGI's debugger and other tools.  For GNU/Linux based mips
> systems, these are not needed.
>
> This patch undefs the MIPS_DEBUGGING_INFO for linux systems (as is
> already done for sde and vxworks) so that the workarounds are not used. 
> I had opened an enhancement PR target/34409 to track the issue.  The
> main thing the patch does is to enable the generation of
> DW_CFA_def_cfa_register codes in the dwarf2 frame data.  This is 1 - 2
> bytes shorter than the DW_CFA_def_cfa that it replaces.
>
> The end result is that the size of the .debug_frame section in
> libstdc++.so is reduced by 76 bytes out of 66124 (a whopping 0.1%).  In
> theory there can be space savings in the .eh_frame section as well, but
> because the fde records are 4 byte aligned, there is no actual savings
> in libstdc++.so as the savings was padded away.

Ugh, what a mess.  MIPS_DEBUGGING_INFO isn't documented and seems to be
used for two distinct purposes: to control IRIX DWARF workarounds and to
choose between standard COFF and MIPS ECOFF.  I suppose that while the
dwarf2out.c stuff has a negative impact on output quality, the sdbout.c
stuff, on the whole, has a positive effect.  On the other hand, I think
the only MIPS configurations that still use sdbout.c are OpenBSD and
VxWorks, and like you say, the latter explicitly doesn't want
MIPS_DEBUGGING_INFO to be defined.

So it looks like the only ports that actually want MIPS_DEBUGGING_INFO
to be defined are mips*-irix* and mips*-openbsd*, both of which are
probably in "slow bitrot" mode.  If that's right, I think we should
remove all the current config/mips MIPS_DEBUGGING_INFO stuff and
instead define MIPS_DEBUGGING_INFO in config/mips/iris.h and
config/mips/openbsd.h.  Does that sound OK?  If so, do you want
to do it, or should I?

Richard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] MIPS: A small optimization for dwarf2 frame data.
  2008-02-26 17:37 ` Richard Sandiford
@ 2008-02-26 17:43   ` David Daney
  2008-02-26 18:01     ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: David Daney @ 2008-02-26 17:43 UTC (permalink / raw)
  To: gcc-patches, rsandifo

Richard Sandiford wrote:
> David Daney <ddaney@avtrex.com> writes:
>> The dwarf frame data produced for most mips targets contains workarounds
>> for bugs in SGI's debugger and other tools.  For GNU/Linux based mips
>> systems, these are not needed.
>>
>> This patch undefs the MIPS_DEBUGGING_INFO for linux systems (as is
>> already done for sde and vxworks) so that the workarounds are not used. 
>> I had opened an enhancement PR target/34409 to track the issue.  The
>> main thing the patch does is to enable the generation of
>> DW_CFA_def_cfa_register codes in the dwarf2 frame data.  This is 1 - 2
>> bytes shorter than the DW_CFA_def_cfa that it replaces.
>>
>> The end result is that the size of the .debug_frame section in
>> libstdc++.so is reduced by 76 bytes out of 66124 (a whopping 0.1%).  In
>> theory there can be space savings in the .eh_frame section as well, but
>> because the fde records are 4 byte aligned, there is no actual savings
>> in libstdc++.so as the savings was padded away.
> 
> Ugh, what a mess.  MIPS_DEBUGGING_INFO isn't documented and seems to be
> used for two distinct purposes: to control IRIX DWARF workarounds and to
> choose between standard COFF and MIPS ECOFF.  I suppose that while the
> dwarf2out.c stuff has a negative impact on output quality, the sdbout.c
> stuff, on the whole, has a positive effect.  On the other hand, I think
> the only MIPS configurations that still use sdbout.c are OpenBSD and
> VxWorks, and like you say, the latter explicitly doesn't want
> MIPS_DEBUGGING_INFO to be defined.
> 
> So it looks like the only ports that actually want MIPS_DEBUGGING_INFO
> to be defined are mips*-irix* and mips*-openbsd*, both of which are
> probably in "slow bitrot" mode.  If that's right, I think we should
> remove all the current config/mips MIPS_DEBUGGING_INFO stuff and
> instead define MIPS_DEBUGGING_INFO in config/mips/iris.h and
> config/mips/openbsd.h.  Does that sound OK?  If so, do you want
> to do it, or should I?

I can only test mips{,64}{,el}-linux, so If you don't mind that the 
patch would be untested, I can do it.  Otherwise if you have access to 
IRIX for testing, perhaps you should.

David Daney

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] MIPS: A small optimization for dwarf2 frame data.
  2008-02-26 17:43   ` David Daney
@ 2008-02-26 18:01     ` Richard Sandiford
  2008-02-26 18:43       ` David Daney
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Sandiford @ 2008-02-26 18:01 UTC (permalink / raw)
  To: David Daney; +Cc: gcc-patches

David Daney <ddaney@avtrex.com> writes:
> Richard Sandiford wrote:
>> So it looks like the only ports that actually want MIPS_DEBUGGING_INFO
>> to be defined are mips*-irix* and mips*-openbsd*, both of which are
>> probably in "slow bitrot" mode.  If that's right, I think we should
>> remove all the current config/mips MIPS_DEBUGGING_INFO stuff and
>> instead define MIPS_DEBUGGING_INFO in config/mips/iris.h and
>> config/mips/openbsd.h.  Does that sound OK?  If so, do you want
>> to do it, or should I?
>
> I can only test mips{,64}{,el}-linux, so If you don't mind that the 
> patch would be untested, I can do it.  Otherwise if you have access to 
> IRIX for testing, perhaps you should.

I don't have access to IRIX either, but I certainly don't mind the patch
going in without being tested on OpenBSD or IRIX.  We're really relying
on folk who care about those targets to test them for us, and the patch
would demonstrably preserve the definitions of MIPS_DEBUGGING_INFO.

I could test a mips*-elf target though, just to be safe.

Richard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] MIPS: A small optimization for dwarf2 frame data.
  2008-02-26 18:01     ` Richard Sandiford
@ 2008-02-26 18:43       ` David Daney
  2008-02-26 19:26         ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: David Daney @ 2008-02-26 18:43 UTC (permalink / raw)
  To: gcc-patches, rsandifo

[-- Attachment #1: Type: text/plain, Size: 1557 bytes --]

Richard Sandiford wrote:
> David Daney <ddaney@avtrex.com> writes:
>   
>> Richard Sandiford wrote:
>>     
>>> So it looks like the only ports that actually want MIPS_DEBUGGING_INFO
>>> to be defined are mips*-irix* and mips*-openbsd*, both of which are
>>> probably in "slow bitrot" mode.  If that's right, I think we should
>>> remove all the current config/mips MIPS_DEBUGGING_INFO stuff and
>>> instead define MIPS_DEBUGGING_INFO in config/mips/iris.h and
>>> config/mips/openbsd.h.  Does that sound OK?  If so, do you want
>>> to do it, or should I?
>>>       
>> I can only test mips{,64}{,el}-linux, so If you don't mind that the 
>> patch would be untested, I can do it.  Otherwise if you have access to 
>> IRIX for testing, perhaps you should.
>>     
>
> I don't have access to IRIX either, but I certainly don't mind the patch
> going in without being tested on OpenBSD or IRIX.  We're really relying
> on folk who care about those targets to test them for us, and the patch
> would demonstrably preserve the definitions of MIPS_DEBUGGING_INFO.
>
> I could test a mips*-elf target though, just to be safe.
>
> Richard
>   
This is what I will test.

OK to commit if no regressions?
2008-02-26  David Daney  <ddaney@avtrex.com>

    PR target/34409
    * config/mips/iris.h (MIPS_DEBUGGING_INFO): Define.
    * config/mips/openbsd.h (MIPS_DEBUGGING_INFO): Same.
    * config/mips/sde.h (MIPS_DEBUGGING_INFO): Remove undef.
    * config/mips/vxworks.h (MIPS_DEBUGGING_INFO): Same.
    * config/mips/mips.h (MIPS_DEBUGGING_INFO): Remove define.



[-- Attachment #2: mips-debugging.diff --]
[-- Type: text/x-patch, Size: 2512 bytes --]

Index: config/mips/iris.h
===================================================================
--- config/mips/iris.h	(revision 132568)
+++ config/mips/iris.h	(working copy)
@@ -22,6 +22,9 @@ along with GCC; see the file COPYING3.  
 #undef TARGET_IRIX
 #define TARGET_IRIX 1
 
+/* MIPS specific debugging info */
+#define MIPS_DEBUGGING_INFO 1
+
 /* The size in bytes of a DWARF field indicating an offset or length
    relative to a debug info section, specified to be 4 bytes in the DWARF-2
    specification.  The SGI/MIPS ABI defines it to be the same as PTR_SIZE.  */
Index: config/mips/sde.h
===================================================================
--- config/mips/sde.h	(revision 132568)
+++ config/mips/sde.h	(working copy)
@@ -72,9 +72,8 @@ along with GCC; see the file COPYING3.  
 #undef DEFAULT_SIGNED_CHAR
 #define DEFAULT_SIGNED_CHAR 0
 
-/* SDE-MIPS won't ever support SDB or MIPS debugging info.  */
+/* SDE-MIPS won't ever support SDB debugging info.  */
 #undef SDB_DEBUGGING_INFO
-#undef MIPS_DEBUGGING_INFO
 
 /* Describe how we implement __builtin_eh_return.  */
 
Index: config/mips/openbsd.h
===================================================================
--- config/mips/openbsd.h	(revision 132568)
+++ config/mips/openbsd.h	(working copy)
@@ -95,3 +95,6 @@ along with GCC; see the file COPYING3.  
 /* Switch into a generic section.  */
 #undef TARGET_ASM_NAMED_SECTION
 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
+
+/* MIPS specific debugging info */
+#define MIPS_DEBUGGING_INFO 1
Index: config/mips/mips.h
===================================================================
--- config/mips/mips.h	(revision 132568)
+++ config/mips/mips.h	(working copy)
@@ -1078,7 +1078,6 @@ enum mips_code_readable_setting {
 #endif
 \f
 #define DBX_DEBUGGING_INFO 1		/* generate stabs (OSF/rose) */
-#define MIPS_DEBUGGING_INFO 1		/* MIPS specific debugging info */
 #define DWARF2_DEBUGGING_INFO 1         /* dwarf2 debugging info */
 
 #ifndef PREFERRED_DEBUGGING_TYPE
Index: config/mips/vxworks.h
===================================================================
--- config/mips/vxworks.h	(revision 132568)
+++ config/mips/vxworks.h	(working copy)
@@ -79,9 +79,6 @@ VXWORKS_LINK_SPEC
 #undef MIPS_DEFAULT_GVALUE
 #define MIPS_DEFAULT_GVALUE 0
 
-/* Other formats are already disabled in config/vxworks.h.  */
-#undef MIPS_DEBUGGING_INFO
-
 /* No _mcount profiling on VxWorks.  */
 #undef FUNCTION_PROFILER
 #define FUNCTION_PROFILER VXWORKS_FUNCTION_PROFILER

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] MIPS: A small optimization for dwarf2 frame data.
  2008-02-26 18:43       ` David Daney
@ 2008-02-26 19:26         ` Richard Sandiford
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Sandiford @ 2008-02-26 19:26 UTC (permalink / raw)
  To: David Daney; +Cc: gcc-patches

David Daney <ddaney@avtrex.com> writes:
> This is what I will test.
>
> OK to commit if no regressions?
> 2008-02-26  David Daney  <ddaney@avtrex.com>
>
>     PR target/34409
>     * config/mips/iris.h (MIPS_DEBUGGING_INFO): Define.
>     * config/mips/openbsd.h (MIPS_DEBUGGING_INFO): Same.
>     * config/mips/sde.h (MIPS_DEBUGGING_INFO): Remove undef.
>     * config/mips/vxworks.h (MIPS_DEBUGGING_INFO): Same.
>     * config/mips/mips.h (MIPS_DEBUGGING_INFO): Remove define.

OK if it passes, thanks.

Richard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-26 19:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-26  5:26 [Patch] MIPS: A small optimization for dwarf2 frame data David Daney
2008-02-26 17:37 ` Richard Sandiford
2008-02-26 17:43   ` David Daney
2008-02-26 18:01     ` Richard Sandiford
2008-02-26 18:43       ` David Daney
2008-02-26 19:26         ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).