internal compiler error

chris hermansen clhermansen@gmail.com
Sat Jun 21 23:29:19 GMT 2025


I did a git pull and I see this as the latest commit in the git log:

commit 5ae3ccf0364d8246c0e82e2da43962e5ce264748 (HEAD -> a68, origin/a68,
origin/HEAD)
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Sat Jun 21 23:35:34 2025 +0200

    algol68: do not rely in DEFLEXED to remove just one flex from a mode

    The DEFLEXED macro, provided by the parser, removes up to two levels
    of flex from the given mode and not just one.  The function
    fill_in_buffer needs to remove just one flex level so it can recognize
    strings properly.

So I think I got your change!  I then did:
make
make check-algol68
sudo make install

Grabbed a new terminal, ran ga68 test2.a68 and it compiled fine and running
a.out produced the results I expected.

Thanks a lot!

On Sat, Jun 21, 2025 at 2:38 PM Jose E. Marchesi <jemarch@gnu.org> wrote:

>
> Hello Chris.
>
> Thanks for reporting this problem.
> Turns out the DEFLEXED parser macro didn't do what I thought it did.
> I just pushed a fix to the a68 branch.
>
> Please pull and give it a try.  It must work much better now.
> Salud!
>
> > Good morning, everyone,
> >
> > I have been working on a group of small utility routines to exercise my
> > Algol 68 fu and this one:
> >
> > begin
> >
> > proc split = (string s, char d) [] string:
> > begin
> > int fieldcount := 1;
> > for p from LWB s to UPB s do
> > if s[p] = d then
> > fieldcount +:= 1
> > fi
> > od;
> > [1:fieldcount] string fields;
> > fieldcount := 1;
> > int fieldstart := LWB s;
> > for p from LWB s to UPB s do
> > if s[p] = d then
> > fields[fieldcount] := (p > fieldstart | s[fieldstart:(p - 1)] | "");
> > fieldcount +:= 1;
> > fieldstart := p + 1
> > fi
> > od;
> > fields[fieldcount] := (UPB s > fieldstart | s[fieldstart:UPB s] | "");
> > fields
> > end;
> >
> > [] string foo = split("Hi there my friend", " ");
> >
> > for field from LWB foo to UPB foo do
> > puts(foo[field]);
> > puts("'n")
> > od
> >
> >
> > end
> >
> > when compiled with ga68 causes an "internal compiler error":
> >
> > In function ‘split’:
> > a681: internal compiler error: Segmentation fault
> > 0x23b61df internal_error(char const*, ...)
> > ../../gcc/diagnostic-global-context.cc:517
> > 0xfed66f crash_signal
> > ../../gcc/toplev.cc:321
> > 0x792d8884580f ???
> > ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
> > 0x9f18ee fill_in_buffer
> > ../../gcc/algol68/a68-low-generator.cc:138
> > 0x9f22ca fill_in_buffer
> > ../../gcc/algol68/a68-low-generator.cc:234
> > 0x9f2673 a68_low_generator(NODE_T*, MOID_T*, bool, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-generator.cc:501
> > 0x9f0b5c a68_lower_variable_declaration(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-decls.cc:201
> > 0x9ed898 a68_lower_initialiser_series(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:187
> > 0x9ed931 a68_lower_serial_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:240
> > 0x9ed898 a68_lower_initialiser_series(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:187
> > 0x9ed931 a68_lower_serial_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:240
> > 0x9ed969 a68_lower_serial_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:219
> > 0x9ed969 a68_lower_serial_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:219
> > 0x9eee08 a68_lower_closed_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:1391
> > 0xa04ee1 a68_lower_routine_text(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-units.cc:1165
> > 0x9ed898 a68_lower_initialiser_series(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:187
> > 0x9ed898 a68_lower_initialiser_series(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:187
> > 0x9ed931 a68_lower_serial_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:240
> > 0x9eee08 a68_lower_closed_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:1391
> > 0x9ed8f8 a68_lower_serial_clause(NODE_T*, LOW_CTX_T)
> > ../../gcc/algol68/a68-low-clauses.cc:250
> > Please submit a full bug report, with preprocessed source.
> > Please include the complete backtrace with any bug report.
> > See <https://gcc.gnu.org/bugs/> for instructions.
> >
> > It's my impression that I should not be submitting this bug to
> > https://gcc.gnu.org/bugs/ since the GNU Algol 68 compiler doesn't yet
> live
> > there (I believe).  If I am mistaken, please correct me!
> >
> > Also, if I can provide any more information, please let me know!
>


-- 
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20250621/51179312/attachment-0001.htm>


More information about the Algol68 mailing list