Add -fno-schedule-insns2 to configure script to stabilize build. (bug 467776 r=lhansen+)
authorEdwin Smith <edwsmith@adobe.com>
Tue, 27 Jan 2009 20:11:55 -0500
changeset 1354 41fc2ca2041a13901256040ad1bdb255df968a64
parent 1353 f503cf2936157969223e6e25208eb348a66ff7ce
child 1355 a40f6db5efb2daaa23a260ad016137255e304b0e
push id281
push useredwsmith@adobe.com
push dateWed, 28 Jan 2009 01:12:57 +0000
reviewerslhansen
bugs467776
Add -fno-schedule-insns2 to configure script to stabilize build. (bug 467776 r=lhansen+) After much bisecting of optimizer flags, this one seems to be the smoking gun. Adding this flag to -O2 or -O3 results in clean stable builds. All indications are that type punning combined with this optimization are a bad mix. Our code is not 100% strict-aliasing clean (must use unions instead of pointer casting) so it's hard to be sure if that's the problem. -fno-strict-aliasing has no effect, nor do any other of the various flags enabled by -O2. test platform: ubuntu 8.10 x86-64 gcc 4.3.2
configure.py
--- a/configure.py
+++ b/configure.py
@@ -180,16 +180,21 @@ elif os == "windows" or os == "cygwin":
         OS_LIBS.append('winmm')
         OS_LIBS.append('shlwapi')
 elif os == "linux":
     MMGC_DEFINES.update({'UNIX': None,
                          'AVMPLUS_UNIX': None,
                          'LINUX': None})
     OS_LIBS.append('pthread')
     APP_CPPFLAGS += '-DAVMPLUS_CDECL '
+    # these warnings are too noisy
+    APP_CXXFLAGS += ' -Wno-parentheses -Wno-c++0x-compat -Wno-empty-body '
+    if cpu == "x86_64":
+        # workaround https://bugzilla.mozilla.org/show_bug.cgi?id=467776
+        OPT_CXXFLAGS += '-fno-schedule-insns2 '
     if config.getDebug():
         OS_LIBS.append("dl")
 elif os == "sunos":
     if config.getCompiler() != 'GCC':
         APP_CXXFLAGS = ""
         OPT_CXXFLAGS = "-xO5 "
         DEBUG_CXXFLAGS = "-g "
     MMGC_DEFINES.update({'UNIX': None,