Title: [278991] trunk/Source/_javascript_Core
Revision
278991
Author
[email protected]
Date
2021-06-17 09:36:37 -0700 (Thu, 17 Jun 2021)

Log Message

[JSC] Work around apparent miscompilation on ARM/GCC >=8.4
https://bugs.webkit.org/show_bug.cgi?id=227125

Reviewed by Filip Pizlo.

This seems to be a GCC miscompilation, revealed by
https://bugs.webkit.org/show_bug.cgi?id=227078.  Introduce a
workaround for the GCC versions that seem to be affected.

* jit/RegisterSet.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (278990 => 278991)


--- trunk/Source/_javascript_Core/ChangeLog	2021-06-17 16:34:20 UTC (rev 278990)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-06-17 16:36:37 UTC (rev 278991)
@@ -1,3 +1,16 @@
+2021-06-17  Angelos Oikonomopoulos  <[email protected]>
+
+        [JSC] Work around apparent miscompilation on ARM/GCC >=8.4
+        https://bugs.webkit.org/show_bug.cgi?id=227125
+
+        Reviewed by Filip Pizlo.
+
+        This seems to be a GCC miscompilation, revealed by
+        https://bugs.webkit.org/show_bug.cgi?id=227078.  Introduce a
+        workaround for the GCC versions that seem to be affected.
+
+        * jit/RegisterSet.h:
+
 2021-06-16  Yusuke Suzuki  <[email protected]>
 
         [JSC] Optimize JSON.parse with small data by changing Identifier pool mechanism

Modified: trunk/Source/_javascript_Core/jit/RegisterSet.h (278990 => 278991)


--- trunk/Source/_javascript_Core/jit/RegisterSet.h	2021-06-17 16:34:20 UTC (rev 278990)
+++ trunk/Source/_javascript_Core/jit/RegisterSet.h	2021-06-17 16:36:37 UTC (rev 278991)
@@ -32,10 +32,27 @@
 #include "Reg.h"
 #include "TempRegisterSet.h"
 #include <wtf/Bitmap.h>
+#include <wtf/Compiler.h>
 
 namespace JSC {
 
-typedef Bitmap<MacroAssembler::numGPRs + MacroAssembler::numFPRs> RegisterBitmap;
+#if CPU(ARM) && COMPILER(GCC)
+
+#if GCC_VERSION_AT_LEAST(8, 4, 0) && !GCC_VERSION_AT_LEAST(9, 0, 0)
+// GCC 8.4.0 and 8.5.0 seem to miscompile WTF:Bitmap::count code on
+// ARM, something that apparently was covered up by the extra
+// word. The issue seems to not manifest with GCC 8.3.0 and >9.
+// Temporarily cover up by adding back the + 1.
+#define REGISTERSET_BITMAP_SLACK 1
+#else
+#define REGISTERSET_BITMAP_SLACK 0
+#endif
+
+#else
+#define REGISTERSET_BITMAP_SLACK 0
+#endif
+
+typedef Bitmap<MacroAssembler::numGPRs + MacroAssembler::numFPRs + REGISTERSET_BITMAP_SLACK> RegisterBitmap;
 class RegisterAtOffsetList;
 
 class RegisterSet {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to