[compiler-rt] r202592 - Avoid type pruning.

Joerg Sonnenberger joerg at bec.de
Sat Mar 1 07:32:06 PST 2014


Author: joerg
Date: Sat Mar  1 09:32:05 2014
New Revision: 202592

URL: http://llvm.org/viewvc/llvm-project?rev=202592&view=rev
Log:
Avoid type pruning.

Modified:
    compiler-rt/trunk/lib/builtins/moddi3.c
    compiler-rt/trunk/lib/builtins/modti3.c

Modified: compiler-rt/trunk/lib/builtins/moddi3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/moddi3.c?rev=202592&r1=202591&r2=202592&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/moddi3.c (original)
+++ compiler-rt/trunk/lib/builtins/moddi3.c Sat Mar  1 09:32:05 2014
@@ -24,7 +24,7 @@ __moddi3(di_int a, di_int b)
     b = (b ^ s) - s;                   /* negate if s == -1 */
     s = a >> bits_in_dword_m1;         /* s = a < 0 ? -1 : 0 */
     a = (a ^ s) - s;                   /* negate if s == -1 */
-    di_int r;
-    __udivmoddi4(a, b, (du_int*)&r);
-    return (r ^ s) - s;                /* negate if s == -1 */
+    du_int r;
+    __udivmoddi4(a, b, &r);
+    return ((di_int)r ^ s) - s;                /* negate if s == -1 */
 }

Modified: compiler-rt/trunk/lib/builtins/modti3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/modti3.c?rev=202592&r1=202591&r2=202592&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/modti3.c (original)
+++ compiler-rt/trunk/lib/builtins/modti3.c Sat Mar  1 09:32:05 2014
@@ -26,9 +26,9 @@ __modti3(ti_int a, ti_int b)
     b = (b ^ s) - s;                   /* negate if s == -1 */
     s = a >> bits_in_tword_m1;         /* s = a < 0 ? -1 : 0 */
     a = (a ^ s) - s;                   /* negate if s == -1 */
-    ti_int r;
-    __udivmodti4(a, b, (tu_int*)&r);
-    return (r ^ s) - s;                /* negate if s == -1 */
+    tu_int r;
+    __udivmodti4(a, b, &r);
+    return ((ti_int)r ^ s) - s;                /* negate if s == -1 */
 }
 
 #endif /* CRT_HAS_128BIT */





More information about the llvm-commits mailing list