[squeak-dev] the NewCompiler and complex numbers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] the NewCompiler and complex numbers

Michael Haupt-3
Hi,

this is puzzling: in a 3.9 image, using the "old" compiler, evaluating
"6 + 6 i" and "6 - 6 i" works fine. Enabling the new compiler, "6 + 6
i" still works, but "6 - 6 i" does not because the compiler converts
it to something nonsensical:

     pushConstant: 6
     pushLit: i
     send: -
     ...

What the heck?

So why would the compiler, all of a sudden, think that i is not a
message selector when it appears after some -?

If this has already been reported, I apologise for creating noise. In
any case, I'd be happy if someone could give me a hint on how to fix
this. BTW it's NewCompiler 174 from SqueakMap.

Best,

Michael

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: the NewCompiler and complex numbers

Michael Haupt-3
Hi again,

it's not just complex numbers. For instance, expressions like "ts1 - 2
days" in TimespanTest >> #testArithmetic" fail in the same way.

I guess it's some problem in dealing with unary minus!?

Best,

Michael

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] the NewCompiler and complex numbers

Igor Stasenko
In reply to this post by Michael Haupt-3
2008/10/15 Michael Haupt <[hidden email]>:

> Hi,
>
> this is puzzling: in a 3.9 image, using the "old" compiler, evaluating
> "6 + 6 i" and "6 - 6 i" works fine. Enabling the new compiler, "6 + 6
> i" still works, but "6 - 6 i" does not because the compiler converts
> it to something nonsensical:
>
>     pushConstant: 6
>     pushLit: i
>     send: -
>     ...
>
> What the heck?
>
> So why would the compiler, all of a sudden, think that i is not a
> message selector when it appears after some -?
>

>From what i see its a serious compiler bug, and should be fixed.

> If this has already been reported, I apologise for creating noise. In
> any case, I'd be happy if someone could give me a hint on how to fix
> this. BTW it's NewCompiler 174 from SqueakMap.
>
> Best,
>
> Michael
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] the NewCompiler and complex numbers

Martin Beck-3
In reply to this post by Michael Haupt-3
Hi Michael,

I don't know, what the bug is, but I have version 281 from the Universe
in 3.10 and for me it generates the correct bytecodes. On SqueakSource,
you even find a newer version 288. The mentioned test works, too.

Best regards,
Martin

Michael Haupt wrote:

> Hi,
>
> this is puzzling: in a 3.9 image, using the "old" compiler, evaluating
> "6 + 6 i" and "6 - 6 i" works fine. Enabling the new compiler, "6 + 6
> i" still works, but "6 - 6 i" does not because the compiler converts
> it to something nonsensical:
>
>      pushConstant: 6
>      pushLit: i
>      send: -
>      ...
>
> What the heck?
>
> So why would the compiler, all of a sudden, think that i is not a
> message selector when it appears after some -?
>
> If this has already been reported, I apologise for creating noise. In
> any case, I'd be happy if someone could give me a hint on how to fix
> this. BTW it's NewCompiler 174 from SqueakMap.
>
> Best,
>
> Michael
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] the NewCompiler and complex numbers

Michael Haupt-3
Hi,

On Wed, Oct 15, 2008 at 10:59 AM, Martin Beck
<[hidden email]> wrote:
> I don't know, what the bug is, but I have version 281 from the Universe
> in 3.10 and for me it generates the correct bytecodes. On SqueakSource,
> you even find a newer version 288. The mentioned test works, too.

that's nice. :-)

Part of my problem is that I'm kind of confined to that version of the
compiler as it contains modifications I'm supposed to use. Installing
a newer version of the compiler over mine would probably break the
extensions in place. :-P

Gaaaa,

Michael