| commit | ee841f4a4aea0739d9a2e19e42593504ed873a78 | [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 | b5b7d3989f50b7704adf4ddf76bd295e318db454 | |
| parent | b1aee72ea035253883718d2f895dda17e4052f08 [diff] [blame] |
don't compile modsi3 into an infinite loop, patch by Matt Johnson! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@127429 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/modsi3.c b/lib/modsi3.c index 388418a..70d38a6 100644 --- a/lib/modsi3.c +++ b/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; }