[llvm-commits] [PATCH] SPARC backend - Passing arguments

Venkatraman Govindaraju venkatra at cs.wisc.edu
Tue Dec 28 14:18:01 PST 2010


Hello,

  This patch makes the SPARC backend to generate correct assembly for
the code below. Before the changes, the seventh parameter (double
%arg1) passed through stack using "std  %f0, [%sp+92]" (store-double)
instruction. Since %sp+92 is not aligned to double word, the
instruction causes a "Bus Error".

 Please let me know whether it is okay to commit.

Thanks,
Venkatraman


; ModuleID = 'arg7.c'
target datalayout =
"E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f128:64:64-n32"
target triple = "sparc-sun-solaris2.11"

@d = global double 0x40934CEFDB09A672

define i32 @test1(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f,
double %arg1) nounwind readnone noinline {
entry:
  ret i32 0
}

define i32 @main() nounwind readonly {
entry:
  %0 = load double* @d, align 8
  %1 = tail call i32 @test1(i32 1, i32 2, i32 3, i32 4, i32 5, i32 10,
double %0) nounwind noinline
  ret i32 %1
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sparc-arg6.patch
Type: text/x-patch
Size: 4858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101228/889e549b/attachment.bin>


More information about the llvm-commits mailing list