Jump to page: 1 2
Thread overview
stops compiling
Mar 19, 2006
debugger
Mar 20, 2006
Thomas Kuehne
Mar 21, 2006
Deewiant
Mar 21, 2006
Thomas Kuehne
Mar 21, 2006
Deewiant
Mar 24, 2006
debugger
Mar 22, 2006
Walter Bright
Mar 23, 2006
Kyle Furlong
Mar 23, 2006
Walter Bright
Mar 23, 2006
Brad Roberts
Mar 24, 2006
Kyle Furlong
Mar 24, 2006
Walter Bright
Mar 23, 2006
debugger
Mar 23, 2006
Regan Heath
Mar 24, 2006
debugger
Mar 24, 2006
BCS
March 19, 2006
dmd 0.149,Win stops compiling without messsage if number of statements is too large.

void init1(){}
void init2(){
init1();
// ... 16,000 times -> stops
//     only 8,000 times -> compiles
init1();
}
void init3(){}

The effect can be seen with the -v option, because init4 does not get code generated


March 20, 2006
debugger schrieb am 2006-03-19:
> dmd 0.149,Win stops compiling without messsage if number of statements is too large.
>
> void init1(){}
> void init2(){
> init1();
> // ... 16,000 times -> stops
> //     only 8,000 times -> compiles
> init1();
> }
> void init3(){}
>
> The effect can be seen with the -v option, because init4 does not get code generated

I can't reproduce this. Are you sure the code above is complete
(I see no "init4")?

Thomas


March 21, 2006
Thomas Kuehne wrote:
> debugger schrieb am 2006-03-19:
>>> dmd 0.149,Win stops compiling without messsage if number of statements is too large.
>>>
>>> void init1(){}
>>> void init2(){
>>> init1();
>>> // ... 16,000 times -> stops
>>> //     only 8,000 times -> compiles
>>> init1();
>>> }
>>> void init3(){}
>>>
>>> The effect can be seen with the -v option, because init4 does not get code generated
> 
> I can't reproduce this. Are you sure the code above is complete
> (I see no "init4")?
> 
> Thomas
> 
> 

I think he typoed and was talking about init3, as that's the behaviour I get. I used code like this:

void init1(){}
void init2(){
// around 16 000 calls to init1()
}
void init3(){ printf("hello"); }
void main() { init3(); }

And nothing was printed when I ran the program - in fact, -v claimed that even main() had no code generated.

Approximately halving the number of calls to init1() (I wasn't counting how
many, just going by his approximate 16 and 8 thousand) made it work fine.
March 21, 2006
Deewiant schrieb am 2006-03-21:
> Thomas Kuehne wrote:
>> debugger schrieb am 2006-03-19:

[snip]

>> I can't reproduce this. Are you sure the code above is complete
>> (I see no "init4")?
>
> I think he typoed and was talking about init3, as that's the behaviour I get. I used code like this:
>
> void init1(){}
> void init2(){
> // around 16 000 calls to init1()
> }
> void init3(){ printf("hello"); }
> void main() { init3(); }
>
> And nothing was printed when I ran the program - in fact, -v claimed that even main() had no code generated.
>
> Approximately halving the number of calls to init1() (I wasn't counting how
> many, just going by his approximate 16 and 8 thousand) made it work fine.

Seems to be a Windows specific bug.

Does
http://dstress.kuehne.cn/run/m/many_functions_02.d
show the same behaviour?

Thomas


March 21, 2006
Thomas Kuehne wrote:
> Deewiant schrieb am 2006-03-21:
>>> Thomas Kuehne wrote:
>>>> debugger schrieb am 2006-03-19:
> 
> [snip]
> 
>>>> I can't reproduce this. Are you sure the code above is complete
>>>> (I see no "init4")?
>>> I think he typoed and was talking about init3, as that's the behaviour I get. I used code like this:
>>>
>>> void init1(){}
>>> void init2(){
>>> // around 16 000 calls to init1()
>>> }
>>> void init3(){ printf("hello"); }
>>> void main() { init3(); }
>>>
>>> And nothing was printed when I ran the program - in fact, -v claimed that even main() had no code generated.
>>>
>>> Approximately halving the number of calls to init1() (I wasn't counting how
>>> many, just going by his approximate 16 and 8 thousand) made it work fine.
> 
> Seems to be a Windows specific bug.
> 
> Does
> http://dstress.kuehne.cn/run/m/many_functions_02.d
> show the same behaviour?
> 
> Thomas
> 
> 

Yes, it does.

D:\Main>dmd asdf.d -v
parse     asdf
semantic  many_functions_02
semantic2 many_functions_02
semantic3 many_functions_02
code      many_functions_02
generating code for function 'init1'
generating code for function 'init2'

And no .exe is generated.

In my previous post, I already had an old asdf.exe which is why "nothing was printed when I ran the program", instead of no program appearing there at all, like in this case.
March 22, 2006
"debugger" <debugger_member@pathlink.com> wrote in message news:dvj2tg$2i3s$1@digitaldaemon.com...
> dmd 0.149,Win stops compiling without messsage if number of statements is
> too
> large.
>
> void init1(){}
> void init2(){
> init1();
> // ... 16,000 times -> stops
> //     only 8,000 times -> compiles
> init1();
> }
> void init3(){}

It's a stack overflow in the compiler. No big deal, it'll be fixed in the next update. I kinda wonder, though, what purpose 16,000 statements serves?


March 23, 2006
Walter Bright wrote:
> "debugger" <debugger_member@pathlink.com> wrote in message news:dvj2tg$2i3s$1@digitaldaemon.com...
>> dmd 0.149,Win stops compiling without messsage if number of statements is too
>> large.
>>
>> void init1(){}
>> void init2(){
>> init1();
>> // ... 16,000 times -> stops
>> //     only 8,000 times -> compiles
>> init1();
>> }
>> void init3(){}
> 
> It's a stack overflow in the compiler. No big deal, it'll be fixed in the next update. I kinda wonder, though, what purpose 16,000 statements serves? 
> 
> 

To try and make a perfect compiler of course! <g> Or did you just increase the stack size? Could I still smash it with say... a million statements?
March 23, 2006
Walter Bright says...
>It's a stack overflow in the compiler. No big deal, it'll be fixed in the next update. I kinda wonder, though, what purpose 16,000 statements serves?

Wow, His Majesty is visiting the populace--and what seems He to be thinking: My bugs are manna for My choosen people, without Me they would starve in the desert.

What is the reason to stack a sequence of statements---and what is the reason for the runtime, that seems to be quadratic in the number of statements within the analyzed function? No answers please, He is the almighty.

16,00 statemenst are too much? Forgive me Master, that was an inadequate try to initialize one of the prides of your creation, an associative array, with some 10,000 elements. Do not try to make Your novices convenient with your pride, You are almighty.


March 23, 2006
On Thu, 23 Mar 2006 05:02:48 +0000 (UTC), debugger <debugger_member@pathlink.com> wrote:

> Walter Bright says...
>> It's a stack overflow in the compiler. No big deal, it'll be fixed in the
>> next update. I kinda wonder, though, what purpose 16,000 statements serves?

<snip puerile garbage>

Troll.

Regan
March 23, 2006
I'm guessing it has to do with inlining or something similar where it's counting functions, but maybe I'm wrong.

Either way, 16,000 statements in the same scope are an obvious example of bad coding style ::).

And, my good sir, I strongly suggest you read this page:

http://redwing.hutman.net/~mreed/

Can you figure out which one you are :)?

-[Unknown]


> Walter Bright says...
>> It's a stack overflow in the compiler. No big deal, it'll be fixed in the next update. I kinda wonder, though, what purpose 16,000 statements serves? 
> 
> Wow, His Majesty is visiting the populace--and what seems He to be thinking: My
> bugs are manna for My choosen people, without Me they would starve in the
> desert.
> 
> What is the reason to stack a sequence of statements---and what is the reason
> for the runtime, that seems to be quadratic in the number of statements within
> the analyzed function? No answers please, He is the almighty.
> 
> 16,00 statemenst are too much? Forgive me Master, that was an inadequate try to
> initialize one of the prides of your creation, an associative array, with some
> 10,000 elements. Do not try to make Your novices convenient with your pride, You
> are almighty.    
> 
> 
« First   ‹ Prev
1 2