Title: [177753] trunk/Source/WTF
Revision
177753
Author
[email protected]
Date
2014-12-26 17:17:01 -0800 (Fri, 26 Dec 2014)

Log Message

Build fix.

Removed use of __builtin_s{add,sub}_overflow introduced in r177729 that was causing a compiler used at Apple to crash because of <rdar://problem/19347133>.

* wtf/SaturatedArithmetic.h:
(signedAddOverflows):
(signedSubtractOverflows):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (177752 => 177753)


--- trunk/Source/WTF/ChangeLog	2014-12-27 00:29:45 UTC (rev 177752)
+++ trunk/Source/WTF/ChangeLog	2014-12-27 01:17:01 UTC (rev 177753)
@@ -1,5 +1,15 @@
 2014-12-26  Dan Bernstein  <[email protected]>
 
+        Build fix.
+
+        Removed use of __builtin_s{add,sub}_overflow introduced in r177729 that was causing a compiler used at Apple to crash because of <rdar://problem/19347133>.
+
+        * wtf/SaturatedArithmetic.h:
+        (signedAddOverflows):
+        (signedSubtractOverflows):
+
+2014-12-26  Dan Bernstein  <[email protected]>
+
         <rdar://problem/19348208> REGRESSION (r177027): iOS builds use the wrong toolchain
         https://bugs.webkit.org/show_bug.cgi?id=139950
 

Modified: trunk/Source/WTF/wtf/SaturatedArithmetic.h (177752 => 177753)


--- trunk/Source/WTF/wtf/SaturatedArithmetic.h	2014-12-27 00:29:45 UTC (rev 177752)
+++ trunk/Source/WTF/wtf/SaturatedArithmetic.h	2014-12-27 01:17:01 UTC (rev 177753)
@@ -39,9 +39,6 @@
 
 inline bool signedAddOverflows(int32_t a, int32_t b, int32_t& result)
 {
-#if COMPILER_HAS_CLANG_BUILTIN(__builtin_sadd_overflow)
-    return __builtin_sadd_overflow(a, b, &result);
-#else
     uint32_t ua = a;
     uint32_t ub = b;
     uint32_t uresult = ua + ub;
@@ -50,7 +47,6 @@
     // Can only overflow if the signed bit of the two values match. If the signed
     // bit of the result and one of the values differ it did overflow.
     return !((ua ^ ub) >> 31) & (uresult ^ ua) >> 31;
-#endif
 }
 
 inline int32_t saturatedAddition(int32_t a, int32_t b)
@@ -71,9 +67,6 @@
 
 inline bool signedSubtractOverflows(int32_t a, int32_t b, int32_t& result)
 {
-#if COMPILER_HAS_CLANG_BUILTIN(__builtin_ssub_overflow)
-    return __builtin_ssub_overflow(a, b, &result);
-#else
     uint32_t ua = a;
     uint32_t ub = b;
     uint32_t uresult = ua - ub;
@@ -82,7 +75,6 @@
     // Can only overflow if the signed bit of the two values do not match. If the
     // signed bit of the result and the first value differ it did overflow.
     return (ua ^ ub) >> 31 & (uresult ^ ua) >> 31;
-#endif
 }
 
 inline int32_t saturatedSubtraction(int32_t a, int32_t b)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to