Strange behavior of compiler optimization.

Brian Makin merimus@yahoo.com
Fri Nov 17 06:54:00 GMT 2000


I do not know if this is a compiler problem but
perhaps someone can grant some insight into my
problem.

I have a large program which I am inserting
threads into.  We currently have 2 development
branches, one with threads and one without thread.
Other than the threads they are nearly identical.

This is the run time with different compiler
options in minutes.

		-g	-O
thread code	9.0	7.5
nonthread code	9.0	5.0

This is running on a multiprocessor sun with gcc,
pthreads, and plenty of resources.

The threaded code is much faster than the treaded
code running all threads sequentially.

Also, if the -O flag is added after the -g flag the
same behavior is seen.  (we have development and
optimized builds and they arn't identical)

I am assuming that I am either causing many cache
misses and hence more bus traffic or the threads
are breaking compiler optimizations.

Any ideas or suggestions to track down this
problem?

merimus at yahoo dot com

__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/


More information about the Gcc mailing list