[LLVMbugs] [Bug 611] "rem double x, y" always returns 0.0

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Aug 3 21:58:43 PDT 2005


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=611

brukman+bugs at uiuc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
           Platform|All                         |PC
         Resolution|FIXED                       |



------- Additional Comments From brukman+bugs at uiuc.edu  2005-08-03 23:58 -------
Just updated from CVS and recompiled, and this still does not work on x86, not
sure about ppc.  In particular, my test case with scanf() still produces 0.0
instead of 1.0 .  Let me know if it actually works for you.

By the way, my C code example has a bug -- and it's not equivalent to the LLVM
code next to it.  The test case is in the LLVM code.

And yes, I do see the call to fmod() in the asm output, but something's not
right -- it seems that eax (which is the return value from fmod) isn't used
after the call to fmod(), although I could be misunderstanding x86 assembly:

main:
        subl $44, %esp
        fnstcw 22(%esp)
        movb $2, 23(%esp)
        fldcw 22(%esp)
        leal 24(%esp), %eax
        movl %eax, 12(%esp)
        leal 32(%esp), %eax
        movl %eax, 8(%esp)
        movl $l1__2E_str_2, 4(%esp)
        movl $l2__2E_str_1, (%esp)
        call sscanf
        fldl 24(%esp)
        fldl 32(%esp)
        fstpl (%esp)
        fstpl 8(%esp)
        call fmod
        movl $l3__2E_str_3, (%esp)
        fstpl 4(%esp)
        call printf
        movl $0, %eax
        #FP_REG_KILL
        addl $44, %esp
        ret



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list