Patchwork Speedups/Cleanups: End of GSOC patch collection

login
register
mail settings
Submitter Dimitrios Apostolou
Date Aug. 18, 2012, 11:49 a.m.
Message ID <alpine.LNX.2.02.1208181422100.20463@localhost.localdomain>
Download mbox | patch
Permalink /patch/178455/
State New
Headers show

Comments

Dimitrios Apostolou - Aug. 18, 2012, 11:49 a.m.
2012-08-18 Dimitrios Apostolou <jimis@gmx.net>

 	* dwarf2out.c (output_indirect_string): Use
 	ASM_OUTPUT_INTERNAL_LABEL instead of slower ASM_OUTPUT_LABEL.
 	* varasm.c (assemble_string): Don't break string in chunks, this
 	is assembler specific and already done in most versions of
 	ASM_OUTPUT_ASCII.


I think there is no correctness issue regarding output_indirect_string()
since .debug_str are always compiler generated labels, and this gives a 
small speedup with -g3 debug info.

And regarding assemble_string() I find it superfluous to break it in two
places. I found only the following versions of ASM_OUTPUT_ASCII not caring 
about string length, I guess the assemblers don't have a limit:

arm.c: vmsdbgout.c:ASM_OUTPUT_ASCII
picochip.c: picochip_output_ascii()
pdp11.c: output_ascii()


Thanks,
Dimitris
=== modified file 'gcc/dwarf2out.c'
--- gcc/dwarf2out.c	2012-08-15 01:56:07 +0000
+++ gcc/dwarf2out.c	2012-08-16 06:19:19 +0000
@@ -20887,7 +20887,7 @@ output_indirect_string (void **h, void *
   if (node->form == DW_FORM_strp)
     {
       switch_to_section (debug_str_section);
-      ASM_OUTPUT_LABEL (asm_out_file, node->label);
+      ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, node->label);
       assemble_string (node->str, strlen (node->str) + 1);
     }

Patch

=== modified file 'gcc/varasm.c'
--- gcc/varasm.c	2012-08-15 01:56:07 +0000

+++ gcc/varasm.c	2012-08-16 06:12:28 +0000

@@ -1726,22 +1726,7 @@  assemble_align (int align)

 void
 assemble_string (const char *p, int size)
 {
-  int pos = 0;

-  int maximum = 2000;

-

-  /* If the string is very long, split it up.  */

-

-  while (pos < size)

-    {

-      int thissize = size - pos;

-      if (thissize > maximum)

-	thissize = maximum;

-

-      ASM_OUTPUT_ASCII (asm_out_file, p, thissize);

-

-      pos += thissize;

-      p += thissize;

-    }

+  ASM_OUTPUT_ASCII (asm_out_file, p, size);

 }