[gambit-list] compiler bug?

Sven.Hartrumpf at FernUni-Hagen.de Sven.Hartrumpf at FernUni-Hagen.de
Mon Sep 3 07:26:08 EDT 2007


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20070903/5146fa50/attachment.sig>


More information about the Gambit-list mailing list