|
From: | john o goyo |
Subject: | [Gm2] Re: LENGTH() on Solaris 10/sparc |
Date: | Mon, 2 Aug 2010 14:24:01 -0400 |
Andreas: On 28-Jul-10, at 7:13 AM, Fischlin Andreas wrote:
Dear John,
[...]
Since I was still confused from your arguments I had a look at the source code and one can easily see in M2RTS what the problem is: RTMS.Length is doing exactly what I described. Thus I have still wrongly understood your explanation and the routines LENGTH and RTMS.Length actually return the number of characters defined in the string variable. If it always returns only 1 for any string variable of any different storage length or value length then it is clear that HIGH is simply buggy and does not return the correct value.
Perhaps the confusion lies in that I did not make it clear that I am merely investigating certain gm2 tests, namely the length tests in testsuite/gm2/iso/pass. These pass on Intel machines but fail on Sparc machines. Yes, HIGH() is buggy but as the same compiler source begats both the Intel and Sparc versions, the cause of the bug is not clear and I am concerned.
Thank you for your insightful comments but I defer to Gaius on the design choices. At this point, my concern is restricted to why the function HIGH() should fail on Sparc but pass on Intel.
john [...]
On 25/Jul/2010, at 03:00 , john o goyo wrote:Andreas: On 24-Jul-10, at 2:20 PM, Fischlin Andreas wrote:Hi John, Sorry, I don't quite get your issue. On 24/Jul/2010, at 04:27 , john o goyo wrote:Examination of the failed test cases shows a real oddity.In a call to LENGTH(s), where s is a string, HIGH(s) is passed as zero and LENGTH(s) is always 1.HIGH(s) is passed as zero has nothing to do with LENGTH(s).[..]Perhaps you are actually talking about something else, but then you should explain better what kind of oddity you actually mean.I wrote the above in the context of gm2, specifically, in the context of the failed test cases of Length(). I shall elucidate.In gm2, LENGTH() is defined in terms of Length() under certain circumstances. If you read the comment before the function Length () in M2RTS.mod, you will find the following.(*Length - returns the length of a string, a. This is called whenever the user calls LENGTH and the parameter cannot be calculatedat compile time. *)In the failed test case iso/run/pass/tstLength.mod, the value of LENGTH(s) is compared to the value of Length(s), where "s" is an array of characters. The former is converted into a call to the latter and the latter uses HIGH(s) in its count. Unfortunately, as I wrote above, HIGH(s) is zero and consequently Length(s) returns 1, hence LENGTH(s) returns 1.john
[Prev in Thread] | Current Thread | [Next in Thread] |