[M3devel] compiler bug
Rodney M. Bates
rodney_bates at lcwb.coop
Thu Jan 21 17:19:39 CET 2016
On 01/20/2016 04:45 PM, Rodney M. Bates wrote:
> If I try to compile with an old cm3 executable named cm3-5.8.6, I get these
> errors trying to compile the cm3 executable (and others too, e.g. mklib):
> ------------------------------------------------------------------------------
> -> linking cm3
> _m3main.c:7:11: error: ‘argc’ was not declared in this scope
> int main (argc, argv, envp)
> ^
> _m3main.c:7:17: error: ‘argv’ was not declared in this scope
> int main (argc, argv, envp)
> ^
> _m3main.c:7:23: error: ‘envp’ was not declared in this scope
> int main (argc, argv, envp)
> ^
> _m3main.c:7:27: error: expression list treated as compound expression in initializer [-fpermissive]
> int main (argc, argv, envp)
> ^
> _m3main.c:8:1: error: expected ‘,’ or ‘;’ before ‘int’
> int argc;
> ^
> _m3main.c:11:1: error: expected unqualified-id before ‘{’ token
> {
> ^
>
> ------------------------------------------------------------------------------
>
> This happens regardless of whether I use upgrade.py, upgrade.sh, do-cm3-front.sh,
> or cm3 directly in the cm3 package.
>
> If I use a cm3 executable compiled on 2015-8-28, compiling sysutils, I can compile
> the libraries and compiler, but when I try to use them to recompile, I get:
>
> --------------------------------------------------------------------------------
> - -> archiving libsysutils.a
>
>
> ***
> *** runtime error:
> *** An array subscript was out of range.
> *** file "../src/M3Build.m3", line 1719
> ***
>
> Aborted (core dumped)
> *** execution of [<function _BuildGlobalFunction at 0x7f9173b8daa0>, <function _ShipFunction at 0x7f9173b8db18>] failed ***
>
> -------------------------------------------------------------------------------
>
> This also happens when I use a saved executable dated 2015-10-18
Attempting to diagnose this problem, I find it has gone away. Don't know what
changed. I used the same cm3 and cm3cg executables, same source code, and did
realcleans both times, but I suppose there must be places for local state to
hide.
Anyway, now it rebuilds itself and converges to identical-sized cm3 executables
after 3 rebuild cycles.
>
>
>
>
> On 01/19/2016 12:09 PM, Rodney M. Bates 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
>>> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel
>>>
>>
>
--
Rodney Bates
rodney.m.bates at acm.org
More information about the M3devel
mailing list