From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513 Description of problem: If modulo operands are long long int, thus __moddi3 is used, and the second argument of modulo is negative, then the result has the opposite sign then the correct one. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Compile the test code as usual: "gcc -Wall t1.c". __moddi3 from libgcc is used and you get the right results. 2. Compile the test code but force it to use __moddi3 from glibc: "gcc -Wall -lc t1.c". You get the wrong results. Actual Results: 3 % 10 = 3 3 % -10 = -3 -3 % 10 = -3 -3 % -10 = 3 Expected Results: 3 % 10 = 3 3 % -10 = 3 -3 % 10 = -3 -3 % -10 = -3 Additional info:
Created attachment 58767 [details] Test code
Created attachment 58768 [details] Proposed patch
Any plan to fix this in the near future? Java "longs" are "long longs" on x86. This bug is definitely having a big impact on us.
http://rhn.redhat.com/errata/RHBA-2002-116.html obsoleted by 2 security erratas in the mean time.