public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/116805] New: -fno-module-lazy breaks thread module when compiled after format module
@ 2024-09-21 18:47 gcc at richy dot net
  2024-09-24  1:13 ` [Bug c++/116805] " nshead at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: gcc at richy dot net @ 2024-09-21 18:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116805

            Bug ID: 116805
           Summary: -fno-module-lazy breaks thread module when compiled
                    after format module
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at richy dot net
  Target Milestone: ---

Created attachment 59171
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59171&action=edit
Collection of *.ii files

richard@microserver:~/scratch/broken> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/richard/gcc/lib/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --host=x86_64-pc-linux-gnu
--prefix=/home/richard/gcc --enable-threads --enable-language=c,c++
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240917 (experimental) (GCC) 

Issued commands below, *.ii files attached.

g++ -std=c++2b -fmodules-ts -fconcepts -fno-module-lazy -Wall -O3 -g -fPIC
-save-temps -x c++-system-header format
g++ -std=c++2b -fmodules-ts -fconcepts -fno-module-lazy -Wall -O3 -g -fPIC
-save-temps -x c++-system-header thread
g++ -std=c++2b -fmodules-ts -fconcepts -fno-module-lazy -Wall -O3 -g -fPIC
-save-temps -c -o ex2.o -x c++ ex2.ixx
In module imported at ex2.ixx:3:1:
/home/richard/gcc/include/c++/15.0.0/thread: error: failed to read compiled
module cluster 1884: Bad file data
/home/richard/gcc/include/c++/15.0.0/thread: note: compiled module file is
‘gcm.cache/./home/richard/gcc/include/c++/15.0.0/thread.gcm’
/home/richard/gcc/include/c++/15.0.0/thread: error: failed to read compiled
module: Bad file data
/home/richard/gcc/include/c++/15.0.0/thread: fatal error: returning to the gate
for a mechanical issue
compilation terminated.
make: *** [Makefile:80: ex2.o] Error 1

Source code:

export module sorttools.sorts:foobar;

import <thread>;

export namespace sorttools::sorts::foobar {

  class Pieces {
  public:        
    std::jthread hello{};
  };

}


On 15.0.0 removing the -fno-module-lazy flag will allow this to compile, as
does swapping the order of format/thread.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/116805] -fno-module-lazy breaks thread module when compiled after format module
  2024-09-21 18:47 [Bug c++/116805] New: -fno-module-lazy breaks thread module when compiled after format module gcc at richy dot net
@ 2024-09-24  1:13 ` nshead at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-09-24  1:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116805

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-09-24
                 CC|                            |nshead at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=114630

--- Comment #1 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed.  I suspect this is a similar issue to PR114630, given it fails at
the same point where Patrick's proposed workaround in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114630#c7 affects.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-24  1:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-21 18:47 [Bug c++/116805] New: -fno-module-lazy breaks thread module when compiled after format module gcc at richy dot net
2024-09-24  1:13 ` [Bug c++/116805] " nshead at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).