Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Poolallocation of higher-order function has assertion error #15121

Open Quuxplusone opened 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR15121
Status NEW
Importance P enhancement
Reported by daneh0000@yahoo.com
Reported on 2013-01-30 09:33:48 -0800
Last modified on 2014-05-06 11:12:32 -0700
Version trunk
Hardware Macintosh MacOS X
CC willdtz@gmail.com
Fixed by commit(s)
Attachments dynarray.c (4192 bytes, application/octet-stream)
Blocks
Blocked by
See also
Created attachment 9948
example program

Consider the attached program. It contains part of an implementation of a
dynamic array in C. It has a map function, which uses C's function pointer
mechanism to simulate a higher-order function. When the map function is
removed, the program successfully compiles. When compiling with the map
function, the below assertion error is raised.

bash-3.2$ clang -flto -fmemsafety -o dynarray.o dynarray.c
Pool allocating 18 global nodes!
[DynArray_new] 3 nodes pool allocatable
[DynArray_add] 3 nodes pool allocatable
[DynArray_map] 3 nodes pool allocatable
[main] 3 nodes pool allocatable
Assertion failed: (!N->isGlobalNode() && "Should be in global mapping!"),
function getLocalPoolNodes, file AllNodesHeuristic.cpp, line 220.
Stack dump:
0.  Running pass 'Pool allocate disjoint data structures' on module 'ld-temp.o'.
clang: error: unable to execute command: Illegal instruction
clang: error: linker command failed due to signal (use -v to see invocation)
Quuxplusone commented 11 years ago

Attached dynarray.c (4192 bytes, application/octet-stream): example program

Quuxplusone commented 11 years ago

Changed product to poolalloc as this is most likely a bug in the poolalloc or DSA code.

Does this error occur without your pass to query pool handles?

Quuxplusone commented 11 years ago

The assertion still triggers without my query pool handle pass.