🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #528

optimization request

#528
From: Glenn Engel
Date: Sat, 12 Aug 1989 05:49
38 lines
1002 bytes
When code gets optimized all variable allocation and function
invokations can be removed from the executable, However, all
char strings are kept.  Is is possible to also eliminate
char strings ?

Here's an example.

#define debug 0

main()
{
  if (debug)
   {
       int i;
       double d;
       printf("wonderful and useful information, %d, %f \n", i, d, 3.14);
   }
}

Compiling this with -O yields

#NO_APP
gcc_compiled.:
.text
LC0:
	.ascii "wonderful and useful information, %d, %f \12\0"
	.even
.globl _main
_main:
	link a6,#0
	unlk a6
	rts

--
 |  Glenn R. Engel
 |  Hewlett-Packard 
 |  (206) 335-2066
 |  glenne%hplsla@hplabs.hp.com
Technical Details
Message-ID: <8908120549.AA19312@labgre.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!iuvax!cica!tut.cis.ohio-state.edu!HPLSLA.HP.COM!glenne

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!iuvax!cica!tut.cis.ohio-state.edu!HPLSLA.HP.COM!glenne
From: glenne@HPLSLA.HP.COM (Glenn Engel)
Newsgroups: gnu.gcc.bug
Subject: optimization request
Message-ID: <8908120549.AA19312@labgre.HP.COM>
Date: 12 Aug 89 05:49:55 GMT
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 38