[LLVMbugs] [Bug 11663] New: ctzdi2: endless recursion

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 27 14:31:27 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=11663

             Bug #: 11663
           Summary: ctzdi2: endless recursion
           Product: compiler-rt
           Version: unspecified
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


On FreeBSD/sparc64, using GCC 4.2.1, ctzdi2.c compilers to the following code:

0000000000000000 <__ctzdi2>:
   0:   9d e3 bf 40     save  %sp, -192, %sp
   4:   82 10 00 18     mov  %i0, %g1
   8:   80 a0 00 18     cmp  %g0, %i0
   c:   85 3e 30 20     srax  %i0, 0x20, %g2
  10:   b0 40 3f ff     addc  %g0, -1, %i0
  14:   90 38 00 18     xnor  %g0, %i0, %o0
  18:   84 0e 00 02     and  %i0, %g2, %g2
  1c:   90 0a 00 01     and  %o0, %g1, %o0
  20:   b0 0e 20 20     and  %i0, 0x20, %i0
  24:   90 12 00 02     or  %o0, %g2, %o0
  28:   40 00 00 00     call  28 <__ctzdi2+0x28>
  2c:   91 32 20 00     srl  %o0, 0, %o0
  30:   b0 06 00 08     add  %i0, %o0, %i0
  34:   81 cf e0 08     rett  %i7 + 8
  38:   91 3a 20 00     sra  %o0, 0, %o0
  3c:   01 00 00 00     nop 

This is due to the fact that __builtin_ctz() emits a call to __ctzdi2(). This
prevents FreeBSD from switching from libgcc to libcompiler_rt on SPARC64.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list