don't compile modsi3 into an infinite loop, patch by Matt Johnson!

llvm-svn: 127429
This commit is contained in:
Chris Lattner 2011-03-10 22:11:46 +00:00
parent 339f7c3c58
commit 15bc34c7c2
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}