[M3devel] compiler bug

Rodney M. Bates rodney_bates at lcwb.coop
Tue Jan 19 22:32:49 CET 2016



On 01/19/2016 02:21 PM, Hosking, Antony L wrote:
> That should work.  What errors do you see with that change?
>

The out of range compiler crash goes away.  The "undefined (n)"
error messages remains, as it should.

The problem I am having now, probably unrelated to this change, is,
when I try to rebuild everything to test that it didn't break
something elsewhere, I got other build failures.  I plan to post
these, but there are so many different build procedures I have tried,
it will take some work to distill it enough for a comprehensible post.


>> On 19 Jan 2016, at 3:13 PM, Rodney M. Bates <rodney_bates at lcwb.coop <mailto:rodney_bates at lcwb.coop>> wrote:
>>
>> That's almost what I did, except as below.  Since i is passed to a
>> CARDINAL in the line below, the i=zero case would not suffer the RT
>> fault.  It would give 0,0 as bounds of the being-compiled Extract,
>> which seems right to me.
>>
>> On 01/19/2016 12:36 PM, Hosking, Antony L wrote:
>>> Can you try this version of Extract.GetBounds?
>>>
>>> PROCEDURE GetBounds (ce: CallExpr.T;  VAR min, max: Target.Int) =
>>>   VAR min_bits, max_bits: Target.Int;  i: INTEGER;
>>>   BEGIN
>>>     Expr.GetBounds (ce.args[2], min_bits, max_bits);
>>>     IF TInt.ToInt (max_bits, i) AND i > 0 AND  i < Word_types[rep].size THEN
>>     ..............................AND 0 <= i .................................
>>>       IF NOT TWord.Extract (TInt.MOne, 0, i, max) THEN
>>>         EVAL Type.GetBounds (T, min, max);
>>>       END;
>>>       min := TInt.Zero;
>>>     ELSE
>>>       (* possible that we'll preserve all bits *)
>>>       Expr.GetBounds (ce.args[0], min, max);
>>>     END;
>>>   END GetBounds;
>>>
>>>> On 19 Jan 2016, at 1:09 PM, Rodney M. Bates <rodney_bates at lcwb.coop <mailto:rodney_bates at lcwb.coop>> wrote:
>>>>
>>>> I have a simple fix that made this RT crash go away, but now I can't rebuild
>>>> the libraries/compiler from all source, with different symptoms for different
>>>> methods.
>>>>
>>>> On 01/17/2016 10:01 PM, Peter McKinna wrote:
>>>>> This is unusual.
>>>>>
>>>>> PROCEDURE Test() =
>>>>>   VAR x,m := 1;
>>>>>   BEGIN
>>>>>     x := Word.Extract(x,m,n);
>>>>>   END Test;
>>>>>
>>>>> induces
>>>>>
>>>>> new source -> compiling test.m3
>>>>> "../src/test.m3", line 190: undefined (n)
>>>>>
>>>>>
>>>>> ***
>>>>> *** runtime error:
>>>>> ***    An enumeration or subrange value was out of range.
>>>>> ***    file "../AMD64_LINUX/WordExtract.m3 => ../src/builtinWord/Extract.mg", l
>>>>> ine 120
>>>>> ***
>>>>>
>>>>> Aborted (core dumped)
>>>>>
>>>>>
>>>>> fix the undefined n and it compiles ok.
>>>>>
>>>>> Any takers to fix this?
>>>>>
>>>>> Should have a bug tracking system really.
>>>>>
>>>>> Peter
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> M3devel mailing list
>>>>> M3devel at elegosoft.com <mailto:M3devel at elegosoft.com>
>>>>> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel
>>>>>
>>>>
>>>> --
>>>> Rodney Bates
>>>> rodney.m.bates at acm.org <mailto:rodney.m.bates at acm.org>
>>>> _______________________________________________
>>>> M3devel mailing list
>>>> M3devel at elegosoft.com
>>>> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel
>>>
>>>
>>
>> --
>> Rodney Bates
>> rodney.m.bates at acm.org <mailto:rodney.m.bates at acm.org>
>

-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the M3devel mailing list