[LLVMbugs] [Bug 2186] New: too many params when passing big struct by value

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Apr 2 03:40:16 PDT 2008


           Summary: too many params when passing big struct by value
           Product: tools
           Version: 2.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jay.foad at antixlabs.com
                CC: llvmbugs at cs.uiuc.edu

I configured llvm-gcc with --target=arm-elf. Then:

$ cat big.c
struct big { int x[0x20000]; };
extern void f(struct big x);
void g() {
        struct big x;
$ cc1 big.c -quiet -emit-llvm-bc -o big.bc
$ opt big.bc
Attribute nounwind only applies to return values!
        call void @f( i64 %tmp3, i64 %tmp5, i64 %tmp7, i64 %tmp9, i64 %tmp11,
i64 %tmp13, i64 %tmp15, ..........................., i64 %tmp131067, i64
%tmp131069, i64 %tmp131071, i64
nounwind  %tmp131073 ) nounwind
Broken module found, compilation aborted!

I think the problem is that the big struct argument gets split into about 2^16
i64 arguments. But the ParamAttrsWithIndex class only uses a 16-bit field to
store the index, so it gets confused into thinking that a return value
attribute also applies to the 2^16th parameter.

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