Thread overview | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 19, 2006 stops compiling | ||||
---|---|---|---|---|
| ||||
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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to debugger Attachments: | 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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | 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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to Deewiant Attachments: | 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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | 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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to debugger | "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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to debugger | 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 Re: stops compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to debugger | 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. > > |
Copyright © 1999-2021 by the D Language Foundation