Bug 827946. GCC 4.5 with PGO miscompiles the ConvolveHorizontally function, so add an annotation to tone down the optmization on that function with GCC 4.5 only. r=joe a=lsblakk
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 13 Feb 2013 16:17:39 -0600
changeset 123980 0e3b5d954cf11f46cea771571bf946c044f33dfd
parent 123979 8c557b7c03a4a753e5c163038f04862e9f65fce1
child 123981 beb2e598079c2565ee462dd03230cf6584043b4e
push id3363
push usertnikkel@gmail.com
push dateWed, 13 Feb 2013 22:18:34 +0000
treeherdermozilla-aurora@0e3b5d954cf1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe, lsblakk
bugs827946
milestone20.0a2
Bug 827946. GCC 4.5 with PGO miscompiles the ConvolveHorizontally function, so add an annotation to tone down the optmization on that function with GCC 4.5 only. r=joe a=lsblakk
gfx/2d/convolver.cpp
--- a/gfx/2d/convolver.cpp
+++ b/gfx/2d/convolver.cpp
@@ -151,18 +151,18 @@ class CircularRowBuffer {
   // Buffer used by GetRowAddresses().
   std::vector<unsigned char*> row_addresses_;
 };
 
 // Convolves horizontally along a single row. The row data is given in
 // |src_data| and continues for the num_values() of the filter.
 template<bool has_alpha>
 // This function is miscompiled with gcc 4.5 with pgo. See bug 827946.
-#if defined(__GNUC__) && defined(MOZ_GCC_VERSION_AT_LEAST)
-#if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0) && !MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)
+#if !defined(__clang__) && defined(__GNUC__)
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
 __attribute__((optimize("-O1")))
 #endif
 #endif
 void ConvolveHorizontally(const unsigned char* src_data,
                           const ConvolutionFilter1D& filter,
                           unsigned char* out_row) {
   // Loop over each pixel on this row in the output image.
   int num_values = filter.num_values();