diff --git a/layout/style/nsCSSDataBlock.cpp b/layout/style/nsCSSDataBlock.cpp
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -541,16 +541,20 @@ nsCSSExpandedDataBlock::ComputeNumProps(
       if (mPropertiesImportant.HasPropertyAt(iHigh, iLow))
         (*aNumPropsImportant)++;
       else
         (*aNumPropsNormal)++;
     }
   }
 }
 
+#ifdef _MSC_VER
+#pragma optimize("g", off)
+#endif
+
 void
 nsCSSExpandedDataBlock::Compress(nsCSSCompressedDataBlock **aNormalBlock,
                                  nsCSSCompressedDataBlock **aImportantBlock,
                                  const nsTArray<uint32_t>& aOrder)
 {
   nsAutoPtr<nsCSSCompressedDataBlock> result_normal, result_important;
   uint32_t i_normal = 0, i_important = 0;
 
@@ -624,16 +628,20 @@ nsCSSExpandedDataBlock::Compress(nsCSSCo
 #endif
 
   ClearSets();
   AssertInitialState();
   *aNormalBlock = result_normal.forget();
   *aImportantBlock = result_important.forget();
 }
 
+#ifdef _MSC_VER
+#pragma optimize("", on)
+#endif
+
 void
 nsCSSExpandedDataBlock::AddLonghandProperty(nsCSSPropertyID aProperty,
                                             const nsCSSValue& aValue)
 {
   MOZ_ASSERT(!nsCSSProps::IsShorthand(aProperty),
              "property out of range");
   nsCSSValue& storage = *static_cast<nsCSSValue*>(PropertyAt(aProperty));
   storage = aValue;
