internal compiler error
chris hermansen
clhermansen@gmail.com
Sat Jun 21 16:39:01 GMT 2025
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/0b3e2d6d/attachment.htm>
More information about the Algol68
mailing list