[LLVMdev] type-system-rewrite branch landing tomorrow

Jin Gu Kang jaykang10 at imrc.kist.re.kr
Mon Jul 11 02:32:16 PDT 2011


> struct T {
>  struct T (*p)(void);
> } t;

This testcase also generates infinite recursion when we use llvm-gcc for arm-target.

Because return type of function pointer p's is struct type T which has one element,
llvm-gcc for arm target calls a function which tries to chang aggregate return type
to inner element. 
(For example, C.HandleAggregateResultAsScalar(Ty);
 --> DefaultABI::HandleReturnType() function gcc/llvm-abi-default.cpp)

In this case, infinite recursion is generated.

So I made a patch.
when function's return type is struct type and this struct type includes only 
function's pointer type as element, funtion's return type is not struct type's element
and is struct type in this patch.
and this patch inserts redundant GetLLVMType() function to remove duplicate
StructsDeferred.push_back().

What do you think about this patch?

Please review this patch.

Thanks,
Jin-Gu Kang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc-4.2-for-arm.patch
Type: application/octet-stream
Size: 2823 bytes
Desc: llvm-gcc-4.2-for-arm.patch
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110711/c097899c/attachment.obj>


More information about the llvm-dev mailing list