[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


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

           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;
        f(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!
/home/foad/llvm/objdir-llvm/Release/bin/opt((anonymous
namespace)::PrintStackTrace()+0x1a)[0x83d981a]
/lib/tls/i686/cmov/libc.so.6(abort+0x109)[0xb7d67fb9]
/home/foad/llvm/objdir-llvm/Release/bin/opt[0x8399c3a]
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