[m-rev.] Error in the C code generated by the compiler

Volker Wysk post at volker-wysk.de
Mon Jan 8 16:51:54 AEDT 2024


Am Montag, dem 08.01.2024 um 14:10 +1100 schrieb Julien Fischer:
> Hi Volker,
> 
> On Sun, 7 Jan 2024, Volker Wysk wrote:
> 
> > I have what I believe is a compiler bug. After I added a semaphore as an
> > input argument to this predicate:
> > 
> > :- pred process(
> >    fis_args::in,
> >    odbc.connection::in,
> >    thread.channel.channel(work_message)::in,
> >    thread.channel.channel(result_message)::in,
> >    thread.semaphore.semaphore::in,
> >    io::di, io::uo)
> > is cc_multi.
> > 
> > ... I get this compiler message:
> > 
> > Mercury/cs/worker.c:237:1: error:
> > ‘mercury_data_thread__semaphore__type_ctor_info_9_0’ undeclared here (not in
> > a function); did you mean
> > ‘mercury_data_thread__semaphore__type_ctor_info_semaphore_0’?
> > 
> > There's no error message about the Mercury code, the problem occurs in the
> > generated C code. Therefore I believe that it's a compiler bug.
> 
> If the error is occuring in C code generated by the Mercury compiler,
> rather than say C code from body of a foreign_proc or foreign_code
> pragam, then that's a bug.

Yes, it is. There's no foreign_proc/foreign_code involved in this module. 

> 
> > Should I send a program that reproduces the problem?
> 
> Yes please.

I've attached the program. It's a bit large. I've stripped it down a little
in order to reduce the dependencies. I've also included a module which was a
library before. 

It shows the problem under Linux (Ubuntu, should also work with other
distributions). Use the mmc-make script. It should reproduce the problem
straightforwardly and produce no other compiler output. Let me know if you
need me to further reduce the compile dependencies.

Cheers,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar.gz
Type: application/x-compressed-tar
Size: 98234 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240108/272273d1/attachment-0001.bin>


More information about the reviews mailing list