[LLVMbugs] [Bug 2911] Assert triggered when complex GC roots initialized

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Oct 25 08:08:01 PDT 2008


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


Gordon Henriksen <gordonhenriksen at mac.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gordonhenriksen at mac.com
             Status|NEW                         |RESOLVED
         Resolution|                            |LATER




--- Comment #1 from Gordon Henriksen <gordonhenriksen at mac.com>  2008-10-25 10:07:48 ---
This is by design. That is, the system only supports using pointers as gcroots.
I don't see this changing before a major redesign of the GC system (but patches
are welcome!).

A workaround would be to create (locally constant) pointers to your structs and
pass those to llvm.gcroot:

    %fp = alloca %FatPointerType
    store %FatPointerType { i8* null, i32 0 }, %FatPointerType* %fp
    %fp_root = alloca %FatPointerType*
    %fp_root2 = bitcast %FatPointerType** %fp_root to i8**
    call void @llvm.gcroot(i8** %fp_root2, i8* null)
    store %FatPointerType* %fp, %FatPointerType** %fp

This will cost an extra indirection in the collector and increase function call
overhead.


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