[LLVMbugs] [Bug 2379] New: va_arg broken with x86_fp80

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed May 28 23:38:32 PDT 2008


           Summary: va_arg broken with x86_fp80
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


; ModuleID = '-'
target datalayout =
target triple = "i686-pc-linux-gnu"

define i32 @a(i32 %i, ...) {
        %l = alloca i8*
        %l1 = bitcast i8** %l to i8*
        call void @llvm.va_start( i8* %l1 )
        %xxx = va_arg i8** %l, x86_fp80
        %ret = va_arg i8** %l, i32
        call void @llvm.va_end( i8* %l1 )
        ret i32 %ret

declare void @llvm.va_start(i8*) nounwind 
declare void @llvm.va_end(i8*) nounwind 

define i32 @main() {
        %call = call i32 (i32, ...)* @a( i32 1, x86_fp80 1.0, i32 195948557 )
        %cmp = icmp ne i32 %call, 195948557
        br i1 %cmp, label %ifthen, label %ifend

ifthen:         ; preds = %entry
        call void @abort( )
        br label %ifend

ifend:          ; preds = %ifthen, %entry
        ret i32 0

declare void @abort()

Run through "llvm-as | lli", should not call abort(), but it does call abort()
on x86 linux.  And if you replace the references to x86_fp80 with references to
double, it does in fact work.

It appears that the implementation of va_arg is ignoring the alignment of

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