Matthias Urlichs wrote: > > tag 195364 +upstream > thanks > > I have looked at this Debian bug (http://bugs.debian.org/195364). The problem > seems to be at line 599 of gforth's engine/main.c, which states > > pi->length = symbols1[i+1]-symbols1[i]; > > symbols[] is an array of consecutive(?) label addresses, and GCC 3.3 happily > inverts their order when compiling engine/engine.c(prim.i). Thus the length > ends up being negative, and the next memcpy() which uses it (in > append_prim()) causes a segfault.
I guess that we will need a 0.6.2 that does more checks on the addresses of the labels. > The proper solution seems to be not to copy the built-in functions in the > first place. I wonder why that is done Gives a speedup by a factor of 2 on average, more than a factor of 3 in one case. Read http://www.complang.tuwien.ac.at/papers/ertl%26gregg03.ps.gz for details. > -- I consider that to be rather > dangerous if the compiler happens to do CSE or similar optimizations. There is no such danger, since the same code is executed, only in a different place (ok, some jumps are also eliminated, but since they jump only to the following instruction, eliminating them is safe. The only problem is that we have to find the start and the end of the code to copy, and the code has to be contiguous, and that's what 3.3 apparently fouls up. - anton --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
