This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Reduce size footprint of empty strings.


On Thu, Feb 25, 2010 at 12:09:46PM +0100, Steven Bosscher wrote:
> On Thu, Feb 25, 2010 at 11:54 AM, Maxim Kuvyrkov <maxim@codesourcery.com> wrote:
> 
> > OK for 4.6?
> >
> > The patch is simple enough to be considered for 4.5, but this is RMs' call.
> 
> It may add some compile time if we loop over all string literals.
> Perhaps gcc can detect empty strings earlier (during parsing?) and
> hijack a flag on STRING_CST nodes?

The loop ends whenever we hit a non-'\0' char.  And, for
char a[100000] = "\0\0";
the STRING_CST length is 3, not 100000.  So it is going to add compile time
only for cases where you have extremely long strings full of
"\0\0\0\0\0\0..."s, something that is really not very common.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]