More <0 strangeness
Alex Holden <[email protected]> Tue, 23 Nov 2004 20:09:27 +0000
| Newsgroups | gmane.comp.lang.forth.picforth |
|---|---|
| Message-ID | <[email protected]> |
This time I appear to have found a weird optimization bug with the <0 word. I haven't yet checked to see if any of the the other comparison operators have a similar problem. <0 always puts -1 on the stack even when the TOS is positive if: * Optimisation is turned on. disallow-optimizations makes it work correctly. * The check is not in a separate word ie. 'dup <0 .' always emits -1 but the following works properly: : test <0 . ; dup test * The <0 is followed by a call to another word, not an 'if'. ie. 'dup <0 if [char] - emit else [char] + emit then' works as expected. -- ------------ Alex Holden - http://www.linuxhacker.org ------------ If it doesn't work, you're not hitting it with a big enough hammer