[LLVMbugs] [Bug 672] NEW: Indirect tail calls fail for functions with more than two arguments

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Dec 2 17:07:11 PST 2005


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

           Summary: Indirect tail calls fail for functions with more than
                    two arguments
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: alex at inga.mit.edu


; seg faults with: llvm-as < tail-break.ll | lli --enable-x86-fastcc
; removing the last argument from the function fixes the seg-fault

int %main(){ 
 %f   = cast int (int, int*, int)* %check_tail to int*
 %res = tail call fastcc int %check_tail( int 10, int* %f,int 10)
 ret int %res
}

fastcc int %check_tail(int %x, int* %f, int %g) {
	%tmp1 = setgt int %x, 0
	br bool %tmp1, label %if-then, label %if-else

if-then:
	%fun_ptr = cast int* %f to int(int, int*, int)*	
	%arg1    = add int %x, -1		
	%res = tail call fastcc int %fun_ptr( int %arg1, int * %f, int %g)
	ret int %res

if-else:
        ret int %x
}



------- 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