public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/43854]  New: names for compiler generated temporaries are too long
@ 2010-04-22 18:10 dann at godzilla dot ics dot uci dot edu
  2010-04-22 18:14 ` [Bug tree-optimization/43854] " pinskia at gcc dot gnu dot org
  2010-04-22 19:54 ` dann at godzilla dot ics dot uci dot edu
  0 siblings, 2 replies; 3+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2010-04-22 18:10 UTC (permalink / raw)
  To: gcc-bugs

Looking at tree dumps, most variables used are compiler generated temporaries
and they have names like pretmp.DECIMAL_NUMBER

If instead of DECIMAL_NUMBER the same number bug in hex was used, this would
reduce the memory used for those temporary names.

This simple patch (that does not take care of all the temporaries, only a
subset):

Index: defaults.h
===================================================================
--- defaults.h  (revision 158360)
+++ defaults.h  (working copy)
@@ -46,12 +46,12 @@

 #ifndef ASM_PN_FORMAT
 # ifndef NO_DOT_IN_LABEL
-#  define ASM_PN_FORMAT "%s.%lu"
+#  define ASM_PN_FORMAT "%s.%lx"
 # else
 #  ifndef NO_DOLLAR_IN_LABEL
-#   define ASM_PN_FORMAT "%s$%lu"
+#   define ASM_PN_FORMAT "%s$%lx"
 #  else
-#   define ASM_PN_FORMAT "__%s_%lu"
+#   define ASM_PN_FORMAT "__%s_%lx"
 #  endif
 # endif
 #endif /* ! ASM_PN_FORMAT */

has this effect on the string pool (for an average size C file (dispnew.c from
emacs):

Before:

avg. entry      17.04 bytes (+/- 8.46)

after:
avg. entry      16.99 bytes (+/- 8.50)


so it's something given how small the change was.

The difference would be even bigger if instead of base 32 or base 64 were used
instead of hex, but that's a larger change...

Also "pretmp" "prehitmp" and "ivtmp" prefixes are too long, they could be one
or two letters...


-- 
           Summary: names for compiler generated temporaries are too long
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        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=43854


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

* [Bug tree-optimization/43854] names for compiler generated temporaries are too long
  2010-04-22 18:10 [Bug tree-optimization/43854] New: names for compiler generated temporaries are too long dann at godzilla dot ics dot uci dot edu
@ 2010-04-22 18:14 ` pinskia at gcc dot gnu dot org
  2010-04-22 19:54 ` dann at godzilla dot ics dot uci dot edu
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-04-22 18:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2010-04-22 18:14 -------
>Also "pretmp" "prehitmp" and "ivtmp" prefixes are too long,

They might be too long but they are useful long without looking too much into
the code to figure out what kind of temp they are.  We could just use D.XYZ
instead without a "long name".  Really debug dumps should be used to debug the
compiler which means having nice names sometimes makes it easier to debug.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug tree-optimization/43854] names for compiler generated temporaries are too long
  2010-04-22 18:10 [Bug tree-optimization/43854] New: names for compiler generated temporaries are too long dann at godzilla dot ics dot uci dot edu
  2010-04-22 18:14 ` [Bug tree-optimization/43854] " pinskia at gcc dot gnu dot org
@ 2010-04-22 19:54 ` dann at godzilla dot ics dot uci dot edu
  1 sibling, 0 replies; 3+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2010-04-22 19:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dann at godzilla dot ics dot uci dot edu  2010-04-22 19:54 -------
(In reply to comment #1)
> >Also "pretmp" "prehitmp" and "ivtmp" prefixes are too long,
> 
> They might be too long but they are useful long without looking too much into
> the code to figure out what kind of temp they are.  We could just use D.XYZ
> instead without a "long name". 

Or using P. (or PR.), I. (or IV.)

> Really debug dumps should be used to debug the
> compiler which means having nice names sometimes makes it easier to debug.

As shown above, the names can be both shorter and nice, it's possible to have
both.


-- 


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


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

end of thread, other threads:[~2010-04-22 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-22 18:10 [Bug tree-optimization/43854] New: names for compiler generated temporaries are too long dann at godzilla dot ics dot uci dot edu
2010-04-22 18:14 ` [Bug tree-optimization/43854] " pinskia at gcc dot gnu dot org
2010-04-22 19:54 ` dann at godzilla dot ics dot uci dot edu

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).