www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - alloca cause DMD compiler error (Internal error: eh.c 54)

reply "Maxime Chevalier-Boisvert" <maximechevalierb gmail.com> writes:
I'm getting a strange compiler error when using alloca in my 
code. What's doubly strange is that I have 2 functions in the 
same file needing to call alloca for the same purpose. It seems 
to work fine in one of the functions, but uncommenting alloca in 
the other causes this cryptic error message to appear:

Internal error: eh.c 54

I believe it might be because the problematic function also 
creates structs on the stack. The following minimal example 
replicates the compiler error:

struct TheStruct
{
     ~this()
     {
     }
}

void bar()
{
}

void foo(IRInstr instr)
{
     auto s = TheStruct();

     bar();

     auto a = alloca(16);
}
Jul 08 2013
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 7/8/2013 10:37 AM, Maxime Chevalier-Boisvert wrote:
 I'm getting a strange compiler error when using alloca in my code.

Please post all bug reports go here: http://d.puremagic.com/issues/
Jul 08 2013
parent Walter Bright <newshound2 digitalmars.com> writes:
On 7/8/2013 11:57 AM, Maxime Chevalier-Boisvert wrote:
 Submitted a new issue: http://d.puremagic.com/issues/show_bug.cgi?id=10575

Thank you!
Jul 08 2013
prev sibling next sibling parent "Peter Alexander" <peter.alexander.au gmail.com> writes:
On Monday, 8 July 2013 at 17:37:10 UTC, Maxime Chevalier-Boisvert 
wrote:
 void foo(IRInstr instr)
 {
     auto s = TheStruct();

     bar();

     auto a = alloca(16);
 }

Looks like this bug: http://d.puremagic.com/issues/show_bug.cgi?id=3753
Jul 08 2013
prev sibling parent "Maxime Chevalier-Boisvert" <maximechevalierb gmail.com> writes:
On Monday, 8 July 2013 at 18:13:33 UTC, Walter Bright wrote:
 On 7/8/2013 10:37 AM, Maxime Chevalier-Boisvert wrote:
 I'm getting a strange compiler error when using alloca in my 
 code.

Please post all bug reports go here: http://d.puremagic.com/issues/

Submitted a new issue: http://d.puremagic.com/issues/show_bug.cgi?id=10575
Jul 08 2013