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
authorTimothy Nikkel <tnikkel@gmail.com>
Fri, 08 Feb 2013 14:01:19 -0600
changeset 131249 be77205650e34c0d9e2e1503bf32f4c9a709a6d9
parent 131248 476d3de99c9cf847e960de314aa4316c330d4b98
child 131250 8d3212955deb14b63d07650eba8c7e380720b0b8
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs827946
milestone21.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 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
gfx/2d/convolver.cpp
--- a/gfx/2d/convolver.cpp
+++ b/gfx/2d/convolver.cpp
@@ -150,16 +150,22 @@ 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)
+__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();
   for (int out_x = 0; out_x < num_values; out_x++) {
     // Get the filter that determines the current output pixel.
     int filter_offset, filter_length;