This is the mail archive of the gcc@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]

Re: mixing optimized and unoptimized code?



David Starner <dvdeug@x8b4e53cd.dhcp.okstate.edu> writes:

> > A related question: which optimizations are not especially memory hungry?
> > I was thinking I could selectively turn on *some* of them on those
> > problematic sources.
> 
> Someone else will have to help you here. But do you know why are these 
> are running out of memory? Are they large files, or template heavy, or
> large functions, or convulted code-wise? If the GCC people know where
> the hot spots are, they can sometimes do amazing improvements in the
> compiler.

They are large files (close to 1MB, preprocessed) containing large
functions. In fact, they are automatically generated files, which, I am
sure, aggravates the problem.  (One of the files is a flex-generated
scanner for Java, which is basically one huge switch statement).

I've made the two problem files available here, if anyone is interested
in taking a look:

http://www.cs.berkeley.edu/~maratb/java-grammar.i.gz
and 
http://www.cs.berkeley.edu/~maratb/java-lexer.i.gz

These files, compiled with 

g++ -fPIC -fno-rtti -fno-exceptions -fno-gnu-keywords -fvtable-thunks -g -O1

give "out of virtual memory" errors at any optimization level.  This is
with gcc 2.95.1 on Solaris (256MB Ultra 10); I've had similar result
with 2.95.2 on Linux (256MB PIII 450).

Marat.


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