[Bug c++/101126] New: Enabling modules suppresses creation of precompiled headers

2021-06-18 Thread overlord624 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101126

Bug ID: 101126
   Summary: Enabling modules suppresses creation of precompiled
headers
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: overlord624 at gmail dot com
  Target Milestone: ---

The output of a precompiled header is suppressed if modules are enabled via
-fmodules-ts. This can be reproduced with the following invocation using any
valid input:
g++-11 -x c++-header -std=c++20 -fmodules-ts -o header.hpp.gch header.hpp

As described in the manual, -fmodules-ts implicitly sets -fmodule-header when
the input is a header file which results in the creation of a compiled header
unit in the module cache and causes the output parameter to be silently ignored
as a side effect.

-
$ g++-11 -v
Using built-in specs.
COLLECT_GCC=g++-11
COLLECT_LTO_WRAPPER=/media/extra/libexec/gcc/x86_64-pc-linux-gnu/11.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /media/extra/sources/gcc/configure --host=x86_64-pc-linux-gnu
--prefix=/media/extra --disable-multilib --enable-threads --enable-tls
--enable-languages=c,c++ --disable-nls
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210402 (experimental) (GCC)

[Bug c++/106009] New: [modules] internal compiler error: in mark_by_value, at cp/module.cc:4775

2022-06-16 Thread overlord624 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106009

Bug ID: 106009
   Summary: [modules] internal compiler error: in mark_by_value,
at cp/module.cc:4775
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: overlord624 at gmail dot com
  Target Milestone: ---

Created attachment 53158
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53158&action=edit
output with -freport-bug

Trying to compile the spdlog library to a header unit causes an internal
compiler error. Adding -save-temps to the parameters causes the same error, but
the compiler claims the error is non-reproducible. No errors occur when the
same header is included in the global module fragment of a regular module.

$ g++-exp -freport-bug -fmodules-ts -std=c++20 -Wall -Wextra -pedantic
-DSPDLOG_COMPILED_LIB -x c++-system-header spdlog/spdlog.h
/usr/include/spdlog/spdlog.h: internal compiler error: in mark_by_value, at
cp/module.cc:4775
0x7112a2 trees_out::mark_by_value(tree_node*)
/media/extra/sources/gcc/gcc/cp/module.cc:4775
0xabe961 trees_out::mark_declaration(tree_node*, bool)
/media/extra/sources/gcc/gcc/cp/module.cc:12245
0xabebd9 trees_out::mark_class_def(tree_node*)
/media/extra/sources/gcc/gcc/cp/module.cc:11744
0xac859d depset::hash::find_dependencies(module_state*)
/media/extra/sources/gcc/gcc/cp/module.cc:13126
0xac8cc0 module_state::write_begin(elf_out*, cpp_reader*, module_state_config&,
unsigned int&)
/media/extra/sources/gcc/gcc/cp/module.cc:17640
0xac9f84 finish_module_processing(cpp_reader*)
/media/extra/sources/gcc/gcc/cp/module.cc:19962
0xa58c85 c_parse_final_cleanups()
/media/extra/sources/gcc/gcc/cp/decl2.cc:5156
0xc7ab60 c_common_parse_file()
/media/extra/sources/gcc/gcc/c-family/c-opts.cc:1253
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See  for instructions.
Preprocessed source stored into /tmp/cc4TWK1u.out file, please attach this to
your bugreport.

$ g++-exp -v
Using built-in specs.
COLLECT_GCC=g++-exp
COLLECT_LTO_WRAPPER=/media/extra/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /media/extra/sources/gcc/configure --host=x86_64-pc-linux-gnu
--prefix=/media/extra --disable-multilib --enable-threads --enable-tls
--enable-languages=c,c++ --disable-nls
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20220616 (experimental) (GCC)

[Bug c++/106009] [modules] internal compiler error: in mark_by_value, at cp/module.cc:4775

2022-06-16 Thread overlord624 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106009

--- Comment #1 from John Smith  ---
Created attachment 53159
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53159&action=edit
preprocessed with -save-temps