On Sat, Jul 9, 2011 at 4:27 PM, Chris Lattner <clattner at apple.com> wrote:> I'm sorry, I've been away from the computer. I'll investigate this in the next half hour. Thanks for the test cases!One more testcase, which might be of interest; crashes clang on x86-64: struct T { struct T (*p)(void); } t; -Eli
On Jul 9, 2011, at 4:35 PM, Eli Friedman wrote:> On Sat, Jul 9, 2011 at 4:27 PM, Chris Lattner <clattner at apple.com> wrote: >> I'm sorry, I've been away from the computer. I'll investigate this in the next half hour. Thanks for the test cases! > > One more testcase, which might be of interest; crashes clang on x86-64: > > struct T { > struct T (*p)(void); > } t;This testcase is fixed in r134853, Jay's isn't fixed yet though. Thanks for the great testcase! -Chris
> 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>