Bug 799295 - Work around gcc 4.5 miscompilation of CanEncodeInfoInHeader by always inlining it
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 23 Nov 2012 07:44:30 +0100
changeset 114058 d8e4f06198dc4933b0011b396ad1d41a063312a1
parent 114057 c27455415eacc423c0b542b3dd39a74a3d0798d6
child 114068 cfafa3e839381f02f93cb0d329721cbd7c7e7417
child 127093 9a4f3dcf37302f068a4813670dea683442e53b90
push id23897
push usermh@glandium.org
push dateFri, 23 Nov 2012 06:45:44 +0000
treeherdermozilla-central@d8e4f06198dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs799295
milestone20.0a1
first release with
nightly linux32
d8e4f06198dc / 20.0a1 / 20121123030827 / files
nightly linux64
d8e4f06198dc / 20.0a1 / 20121123030827 / files
nightly mac
d8e4f06198dc / 20.0a1 / 20121123030827 / files
nightly win32
d8e4f06198dc / 20.0a1 / 20121123030827 / files
nightly win64
d8e4f06198dc / 20.0a1 / 20121123030827 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 799295 - Work around gcc 4.5 miscompilation of CanEncodeInfoInHeader by always inlining it
js/src/ion/Safepoints.cpp
--- a/js/src/ion/Safepoints.cpp
+++ b/js/src/ion/Safepoints.cpp
@@ -182,17 +182,21 @@ AllocationToPartKind(const LAllocation &
     if (a.isRegister())
         return Part_Reg;
     if (a.isStackSlot())
         return Part_Stack;
     JS_ASSERT(a.isArgument());
     return Part_Arg;
 }
 
-static inline bool
+// gcc 4.5 doesn't actually inline CanEncodeInfoInHeader when only
+// using the "inline" keyword, and miscompiles the function as well
+// when doing block reordering with branch prediction information.
+// See bug 799295 comment 71.
+static MOZ_ALWAYS_INLINE bool
 CanEncodeInfoInHeader(const LAllocation &a, uint32 *out)
 {
     if (a.isGeneralReg()) {
         *out = a.toGeneralReg()->reg().code();
         return true;
     }
 
     if (a.isStackSlot())