commit | 15bc34c7c215ff05a8c51a679ea19cb28cd91d1a | [log] [tgz] |
---|---|---|
author | Chris Lattner <sabre@nondot.org> | Thu Mar 10 22:11:46 2011 +0000 |
committer | Chris Lattner <sabre@nondot.org> | Thu Mar 10 22:11:46 2011 +0000 |
tree | 7b3c4371d38f0023a03c10f81ed062293f6cdd26 | |
parent | 339f7c3c5841bb3b534d5a504debf0ba2dd8b35b [diff] |
don't compile modsi3 into an infinite loop, patch by Matt Johnson! llvm-svn: 127429
diff --git a/compiler-rt/lib/modsi3.c b/compiler-rt/lib/modsi3.c index 388418a..70d38a6 100644 --- a/compiler-rt/lib/modsi3.c +++ b/compiler-rt/lib/modsi3.c
@@ -14,10 +14,12 @@ #include "int_lib.h" +su_int __divsi3(si_int a, si_int b); + /* Returns: a % b */ si_int __modsi3(si_int a, si_int b) { - return a - (a / b) * b; + return a - __divsi3(a, b) * b; }