gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ICE on procedure-local CONST declaration


From: Gaius Mulley
Subject: Re: ICE on procedure-local CONST declaration
Date: Mon, 15 Jul 2024 17:39:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Alcor <alcor@tilde.club> writes:

> Hi all,
>
> The following program (Test.mod) causes an ICE on gm2 (GCC) 15.0.1 20240707 
> (x86_64, Arch Linux):
>
> --
>
> MODULE Test;
>
> IMPORT SYSTEM;
>
> TYPE
>       T = POINTER TO CONS;
>       CONS = RECORD
>               CAR: SYSTEM.ADDRESS;
>               CDR: T;
>       END;
>
> PROCEDURE POP(VAR LST: T): SYSTEM.ADDRESS;
>       CONST CAR = LST.CAR;
> BEGIN
>       RETURN NIL;
> END POP;
>
> BEGIN
> END Test.
>
> --
>
> I am not entirely sure whether this is valid Modula-2 code. I'm just
> experimenting with the compiler by attempting to write a toy Lisp
> implementation in M2 and thought this may be worth reporting.
>
> The full backtrace (as producer by -freport-bug) is available below:
>
> --
>
> // Target: x86_64-pc-linux-gnu
> // Configured with: /home/vagrant/gcc-snapshot/src/gcc/configure 
> --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust 
> --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib 
> --mandir=/usr/share/man --infodir=/usr/share/info 
> --with-bugurl=https://aur.archlinux.org/packages/gcc-snapshot 
> --with-build-config=bootstrap-lto --with-linker-hash-style=gnu 
> --with-system-zlib 
> --with-isl-include=/home/vagrant/gcc-snapshot/src/gcc-15-20240707/isl/include 
> --enable-__cxa_atexit --enable-cet=auto --enable-checking=release 
> --enable-clocale=gnu --enable-default-pie --enable-default-ssp 
> --enable-gnu-indirect-function --enable-gnu-unique-object 
> --enable-libstdcxx-backtrace --enable-link-serialization=1 
> --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin 
> --enable-shared --enable-threads=posix --disable-libssp 
> --disable-libstdcxx-pch --disable-werror
> // Thread model: posix
> // Supported LTO compression algorithms: zlib zstd
> // gcc version 15.0.1 20240707 (experimental) (GCC) 
> // 
> // terminate called after throwing an instance of 'unsigned int'
> // -quiet: internal compiler error: Aborted
> // 0x746acf __gnu_cxx::__verbose_terminate_handler()
> //    /usr/src/debug/gcc-snapshot/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
> // 0x1925979 __cxxabiv1::__terminate(void (*)())
> //    
> /usr/src/debug/gcc-snapshot/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
> // 0x7469f2 std::terminate()
> //    
> /usr/src/debug/gcc-snapshot/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
> // 0x1925b28 __cxa_throw
> //    /usr/src/debug/gcc-snapshot/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
> // 0x757466 gm2_parse_input_files
> //    /usr/src/debug/gcc-snapshot/gcc/gcc/m2/gm2-lang.cc:827
> // 0x757466 gm2_langhook_parse_file
> //    /usr/src/debug/gcc-snapshot/gcc/gcc/m2/gm2-lang.cc:834
> // Please submit a full bug report, with preprocessed source.
> // Please include the complete backtrace with any bug report.
> // See <https://aur.archlinux.org/packages/gcc-snapshot> for instructions.
>
> // /usr/lib/gcc/x86_64-pc-linux-gnu/15.0.1/cc1gm2 -quiet -dumpdir a- 
> -dumpbase Test.mod -dumpbase-ext .mod -mtune=generic -march=x86-64 
> -freport-bug -fm2-pathname=- -fm2-pathnameI. -fgen-module-list=- 
> -fscaffold-dynamic -fscaffold-main -flibs=m2cor,m2log,m2pim,m2iso 
> -fm2-pathname=- -fm2-pathnameI. Test.mod -o - -frandom-seed=0 -fdump-noaddr
>
> --
>
> FWIW, this behavior is also observable on GM2 13.2.0 (x86_64; Ubuntu)
> and GM2 14.1.1 (x86_64; Arch). I tested different revisions of the
> compiler before attempting the latest GM2 snapshot.

Hi Alcor,

many thanks for the bug report - the compiler shouldn't ICE (I will fix
this!),

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]