gcc -O2 miscompiled XFree86 4.0.1b. bitmap dumps core when selecting File -> New or File -> Resize. Using -O generates a working bitmap.
It is not a gcc bug, but a bug in Xaw. Jakub's patch for Xaw has been checked into XFree86 CVS.