[Bug middle-end/43855] New: assembly labels are too long

dann at godzilla dot ics dot uci dot edu gcc-bugzilla@gcc.gnu.org
Thu Apr 22 18:10:00 GMT 2010


Assembly labels are generated like thisL .LDECIMAL_NUMBER
If instead of DECIMAL_NUMBER the hex version of the same number (or even better
base 32 or base 64) the total assembly size would be reduced.

For combine.s the file size difference for using hex is %1.5 for -O2 -S (if I
remember well)

Here's an emacs function that will estimate the size.  Evaluate the function,
open the .s file and do M-x my-estimate, it will show the size savings
estimate.

(defun my-estimate ()
  (interactive)
  (let ((crt-size (point-max)))
    (goto-char (point-min))
    (while (re-search-forward "\\([.]L[A-Z]*\\)\\([0-9]+\\)" nil t)
      (replace-match (format "%s%x" (match-string 1) (string-to-number
(match-string 2))) nil nil))
    (message "Size %% change = %f" (/ (* 100.0 (- (point-max) crt-size))
(point-max)))))

This is a rather simple minded estimate, but it shouldn't bet too far.
Things like .LBB and .LBE need to be considered carefully.
This should help speed up the assembler a bit...


-- 
           Summary: assembly labels are too long
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43855



More information about the Gcc-bugs mailing list