(unknown charset) Re: [BLACKBOX] Possible compiler bug ?

From: (unknown charset) [at]} <Robert>
Date: Mon, 19 Dec 2011 23:11:56 +0000

----boundary-LibPST-iamunique-185251411_-_-
Content-type: text/plain

Aubrey

Yes - this seems to work - thanks.

I have no idea what the line is doing!

Cheers

Robert



On 19/12/2011 21:25, Aubrey.McIntosh{([at]})nowhere.xy
> Also, add the statement rev := ~rev
> IF y.mode # Reg THEN LoadR(y); rev := ~rev END;(* <<< add this line *)
>
>
> MODULE BugMeter;
>
> TYPE
> Meter = POINTER TO RECORD
> maxVal : INTEGER;
> steps : INTEGER
> END;
>
> PROCEDURE Do*;
> VAR
> pos, val : INTEGER;
> meter : Meter;
> BEGIN
> NEW(meter);
> meter.maxVal := 9999;
> meter.steps := 100;
> val := 500;
> pos := SHORT (LONG (val) * meter.steps DIV meter.maxVal);
> HALT(100) (*This traps with pos = 5*)
> END Do;
>
> END BugMeter.Do
>
>
> On Mon, Dec 19, 2011 at 12:22 PM, Robert <robert.campbell_{([at]})nowhere.xy
> <mailto:robert.campbell_{([at]})nowhere.xy
>
> Luowy
>
> I tried this, and my source code compiles, but crashes at run-time.
>
> The line is (now !)
>
> pos := SHORT (LONG (val) * meter.steps DIV meter.maxVal);
>
> All variables are INTEGERS.
> val is 0, meter.steps is 100, and meter.maxVal is 9999.
>
> If I copy meter.maxVal into a local temporary variable (maxVal) it works
> fine with the unmodified compiler, but still crashes at runtime with the
> modification.
>
>
> I need to use LONGINTs in the expression because sometimes val & maxVal may
> exceed 2^31 / 100.
>
>
> I believe there is a clever way of computing a * b MOD c without suffering
> overflow problems; it is used in ObxRandom. But understanding that trick is
> a theoretical detour I haven't the time for just now.
>
>
> I know my posted example is incomplete as a runnable program; it was meant
> to be a minimal example of the compiler problem.
>
>
> Regards
>
> Robert
>
>
>
> On 19/12/2011 17:12, luowy{([at]})nowhere.xy
>
> add one line:
>
> DevCPC486.FloatDOp
> ...
> | div:
> IF y.mode # Reg THEN LoadR(y); END;(*<<< add this line *)
> IF rev THEN Dev2CPL486.GenFDOp(FDIVR, y) ELSE Dev2CPL486.GenFDOp(FDIV,
> y) END;
> Floor(y,FALSE)
> ...
>
>
>
> ----- 原文 -----
> 发件人: Aubrey.McIntosh{([at]})nowhere.xy
> <mailto:Aubrey.McIntosh{([at]})nowhere.xy
> 主 题: Re: [BLACKBOX] Possible compiler bug ?
> 时 间: 2011年12月19日 22:25:12
>
> It compiles to completion in V4:iOP2 RC/NM V1.7 22.1.1996
> compiling DemoMeter; new symbol file 58And the user program traps at the
> expected place on the NIL pointer.
>
> I think that the BlackBox compiler is a descendant of the original OP2
> compiler. There is an early 90s paper that describes the internal data
> structures of OP2. Is it obvious to anyone how to walk down the source
> for the two compiler execution paths side by side to see what catches
> the eye?
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2012.0.1890 / Virus Database: 2108/4689 - Release Date: 12/18/11
>
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy
>
>
>
>
> --
> Aubrey McIntosh, Ph.D.
> 1502 Devon Circle
> Austin TX 78723-1814
> http://home.grandecom.net/~amcintosh/aubrey/Search/
>
> ---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2012.0.1890 / Virus Database: 2108/4690 - Release Date: 12/19/11
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-185251411_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzkzNlxmcm9tdGV4dCBcZGVmZjB7XGZvbnR0YmwNCntcZjBcZnN3
aXNzXGZjaGFyc2V0MTM0IFNpbVN1bjt9DQp7XGYxXGZtb2Rlcm4gU2ltU3VuO30NCntcZj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CfX0AXGh0bWxydGYgIFw=
----boundary-LibPST-iamunique-185251411_-_---
Received on Tue Dec 20 2011 - 00:11:56 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:09 UTC