Re: [gambit-list] compiler bug?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 25-Sep-06, at 3:48 PM, Sven.Hartrumpf@FernUni-Hagen.de wrote:
Hello Marc.
I have a large program which behaves a little different with gsc than any other Scheme I know of (bigloo, chicken, gauche): Here is the problematic region:
(let* ((orth (and (pair? word-info) ;(not (eq? (caar word-info) 'words)) (fs-value (car word-info) '(orth)))) (orth-l (if orth (string-length orth) 0)) (left-hyphen (and (> orth-l 2) (char=? (string-ref orth 0) # \-))) ; examples: \quw{Steuergesetzgebung und -verwaltung}, \quw {auspringen und -setzen} (right-hyphen (and (> orth-l 1) (char=? (string-ref orth (- orth- l 1)) #\-))) (step (if left-hyphen (and (not right-hyphen) -1) (and right-hyphen 1))))
left-hyphen and right-hyphen are evaluated to #f for some binding - this is as expected. But step is bound to 1 which seems wrong to me. Minimizing the problem might be hard for me, so I hope that you can see the problem already :-)
Ciao Sven
Sven, you have just uncovered a nasty bug in the compiler. In beta 18 the transformation for the "and" form is too aggressive in the case where the second argument is a constant. As far as I can tell this bug was introduced just before beta 18 was released. Surprisingly in the 70Kloc in the Gambit runtime system and compiler this case does not occur. I have now fixed the bug and will release beta 19 shortly because this is a serious bug. Thanks! Marc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) iD8DBQFFGEqS//V9Zc2T/v4RAqTeAJ9asp7elGoK7yqa6MzmLFTRj6K8UwCfc3d4 5haROCNvlgMs1NREyZCgYIw= =bvLI -----END PGP SIGNATURE-----
Afficher les réponses par date
Hi Marc. Let's continue an old thread: Mon, 25 Sep 2006 17:30:57 -0400, feeley wrote:
On 25-Sep-06, at 3:48 PM, Sven.Hartrumpf wrote:
(step (if left-hyphen (and (not right-hyphen) -1) (and right-hyphen 1))))
left-hyphen and right-hyphen are evaluated to #f for some binding - this is as expected. But step is bound to 1 which seems wrong to me. Minimizing the problem might be hard for me, so I hope that you can see the problem already :-)
Sven, you have just uncovered a nasty bug in the compiler. In beta 18 the transformation for the "and" form is too aggressive in the case where the second argument is a constant. As far as I can tell this bug was introduced just before beta 18 was released. Surprisingly in the 70Kloc in the Gambit runtime system and compiler this case does not occur. I have now fixed the bug and will release beta 19 shortly because this is a serious bug.
The same Scheme code causes incorrect results now for 4.0.0, but this time in a different way :-) (step (if left-hyphen (and (not right-hyphen) -1) (and right-hyphen 1))) In: left-hyphen: #t right-hyphen: #f Out: step: #t Obviously, this should be -1! Greetings Sven
participants (2)
-
Marc Feeley -
Sven.Hartrumpf@FernUni-Hagen.de