On 2002.06.13, Jim Wilcoxson <[EMAIL PROTECTED]> wrote:
> It seems the problem causing our server crashes is that I recompiled
> AOLServer with -O2 on Linux. When compiled with -g, the server
> doesn't crash, and the test case seems to be running reliably at the
> same speed - actually, a little faster.
>
> I'm guessing that gcc doesn't realize the static vars in AS should all
> be considered volatile and an optimization is causing unintended
> behavior. Until vars are declared volatile, maybe there should be a
> note in the makefile to warn against using optimization. Since -O2
> was sitting in Makefile.global and commented out without any reason
> why, I figured it was okay to use it. Wrong!
For fun, I'll use this gcc string:
gcc -O99 -funroll-loops -frerun-cse-after-loop \
-fexpensive-optimizations -fomit-frame-pointer
See what blows up. Good way to find places in the code to review.
Then, if I want to go on a spring cleaning frenzy:
gcc -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
-Wcast-qual -Wchar-subscripts -Wconversion -Winline \
-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
-Wredundant-decls -Wshadow -Wstrict-prototypes \
-Wwrite-strings $*
Talk about ... anal. It's a great exercise to try and make as much
of your code compile without warnings given that set of gcc command
line args, though.
Glad you finally solved your own problem, though, Jim!
-- Dossy
--
Dossy Shiobara mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
"He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)