It seems to be a BUG of ldc2 compiler

tae hoo liteon777 at hanmail.net
Tue Nov 12 19:42:26 PST 2013


<test.d>
module test;
void poo()
{
     wchar[4096] buffW;
}

ldc2 --output-o -c -IC:/LDC/ldc/runtime/druntime/src 
-IC:/LDC/ldc/runtime/druntime/src/gc test.d -oftest.obj -w -d -O0 
-release -IC:/LDC/ldc/runtime/phobos

if you compile the above test.d, same error message generated
>> Unknown frame setup opcode!
>> UNREACHABLE executed at 
>> C:\LDC\llvm\lib\Target\X86\X86MCInstLower.cpp:855!


But, if reduce the stack variable size to below 2000,
error message not generated.

<test.d>
module test;
void poo()
{
     wchar[2000] buffW;
}


It seems to be a BUG of ldc2 compiler not stack alingment problem.







On Tuesday, 12 November 2013 at 17:14:59 UTC, Kai Nacke wrote:
> Hi tae,
>
> On Tuesday, 12 November 2013 at 16:24:26 UTC, tae hoo wrote:
>> I have used your new patch (win64eh_all_20131112.diff).
>> but the same problem generated.
>>
>> Unknown frame setup opcode!
>> UNREACHABLE executed at 
>> C:\LDC\llvm\lib\Target\X86\X86MCInstLower.cpp:855!
>>
>> I compiled with a Visual Studio 2012.
>> I think that the cause of this problem is related with a X64 
>> Prolog and
>> Epliog RSP register realignment.
>>
>> Visual Studio 2012 does over allocates and realigns RSP
>>
>> How to resolve it?
>
> That is PR16779 (http://llvm.org/bugs/show_bug.cgi?id=16779).
> To fix it, you have to change the generation of prolog and 
> epliog code (located in file 
> lib/Target/X86/X86FrameLowering.cpp).
>
>> Would you upate the patch ^^;;;
>
> I tried to solve the mentioned PR but so far I have no solution 
> for it. Sorry.
>
> Currently, I am working on the next release (merge of 2.064), 
> therefore there is no time to fix this. Volunteers are welcome. 
> :-)
>
> Regards,
> Kai



More information about the digitalmars-d-ldc mailing list