Bug 1273048 - Add __attribute__((noinline)) to work around compiler bug on Android/x86. r=xidorn
authorL. David Baron <dbaron@dbaron.org>
Sat, 04 Jun 2016 17:51:30 -0700
changeset 339538 4c3d7660fd3730f2bf51fd32f21f98063ea860c9
parent 339537 efd20b79bbc525828b9a687bd14feb43c93c14d1
child 339539 52a777c32fd644245a07e3ee457fdcfe9ee5f8f5
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1273048
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1273048 - Add __attribute__((noinline)) to work around compiler bug on Android/x86. r=xidorn I tested locally that the MOZ_GCC_VERSION_AT_LEAST() and MOZ_GCC_VERSION_AT_MOST() expressions do sensible things when I fiddle with the numbers to make them more or less than my local gcc version. (I tested this for all 4 expressions.) I don't know for sure that this will fix the crashes we're seeing, but it seems like it should undo the change that triggered it, so I think it's worth trying. MozReview-Commit-ID: IXYYn3mLQBf
layout/style/nsCSSPseudoElements.h
--- a/layout/style/nsCSSPseudoElements.h
+++ b/layout/style/nsCSSPseudoElements.h
@@ -5,16 +5,17 @@
 
 /* atom list for CSS pseudo-elements */
 
 #ifndef nsCSSPseudoElements_h___
 #define nsCSSPseudoElements_h___
 
 #include "nsIAtom.h"
 #include "mozilla/CSSEnabledState.h"
+#include "mozilla/Compiler.h"
 
 // Is this pseudo-element a CSS2 pseudo-element that can be specified
 // with the single colon syntax (in addition to the double-colon syntax,
 // which can be used for all pseudo-elements)?
 #define CSS_PSEUDO_ELEMENT_IS_CSS2                     (1<<0)
 // Is this pseudo-element a pseudo-element that can contain other
 // elements?
 // (Currently pseudo-elements are either leaves of the tree (relative to
@@ -100,16 +101,26 @@ public:
   static bool IsEnabled(Type aType, EnabledState aEnabledState)
   {
     return !PseudoElementHasFlags(aType, CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY) ||
            (aEnabledState & EnabledState::eInUASheets);
   }
 
 private:
   // Does the given pseudo-element have all of the flags given?
+
+  // Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64037 ,
+  // which is a general gcc bug that we seem to have hit only on Android/x86.
+#if defined(ANDROID) && defined(__i386__) && defined(__GNUC__) && \
+    !defined(__clang__)
+#if (MOZ_GCC_VERSION_AT_LEAST(4,8,0) && MOZ_GCC_VERSION_AT_MOST(4,8,4)) || \
+    (MOZ_GCC_VERSION_AT_LEAST(4,9,0) && MOZ_GCC_VERSION_AT_MOST(4,9,2))
+   __attribute__((noinline))
+#endif
+#endif
   static bool PseudoElementHasFlags(const Type aType, uint32_t aFlags)
   {
     MOZ_ASSERT(aType < Type::Count);
     return (kPseudoElementFlags[size_t(aType)] & aFlags) == aFlags;
   }
 
   static const uint32_t kPseudoElementFlags[size_t(Type::Count)];
 };