From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 47A813858D29; Wed, 10 Feb 2021 05:20:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47A813858D29 From: "boris at kolpackov dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99050] New: [modules] ICE in cpp_directive_only_process on include translation Date: Wed, 10 Feb 2021 05:20:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: boris at kolpackov dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2021 05:20:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99050 Bug ID: 99050 Summary: [modules] ICE in cpp_directive_only_process on include translation Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: boris at kolpackov dot net Target Milestone: --- After the fix in bug 98882 I now get an ICE (that same assert) when partial= ly preprocessing (-E -fdirectives-only) a TU that has an include directive tha= t is translated to an import: cat <hello.hxx void f (); EOF cat <main.cxx #include "hello.hxx" //import "hello.hxx"; int main () {} EOF cat <mapper #!/usr/bin/env bash function info () { echo "$*" 1>&2; } function resp () { info " < $*"; echo "$*"; } while read l; do info " > $l" case "$l" in HELLO*) resp "HELLO 1 test ;" ;; MODULE-REPO) resp "PATHNAME /" ;; INCLUDE-TRANSLATE*hello.hxx) resp "PATHNAME $(pwd)/hello.gcm" ;; INCLUDE-TRANSLATE*) resp "BOOL FALSE" ;; MODULE-EXPORT*|MODULE-IMPORT*) resp "PATHNAME $(pwd)/hello.gcm" ;; MODULE-COMPILED*) resp "OK" ;; *) resp "ERROR 'unexpected request: $l'" ;; esac done EOF chmod ugo+x ./mapper g++ -std=3Dc++2a -fmodules-ts -fmodule-mapper=3D'|./mapper' -fmodule-header= -x c++ header hello.hxx g++ -std=3Dc++2a -fmodules-ts -fmodule-mapper=3D'|./mapper' -E -fdirectives= -only -x c++ -o main.ii main.cxx main.cxx:1: internal compiler error: in cpp_directive_only_process, at libcpp/lex.c:4323 0x2c26a7a cpp_directive_only_process(cpp_reader*, void*, void (*)(cpp_reade= r*, CPP_DO_task, void*, ...)) ../../gcc/libcpp/lex.c:4323 0xf1745e scan_translation_unit_directives_only ../../gcc/gcc/c-family/c-ppoutput.c:402 0xf16928 preprocess_file(cpp_reader*) ../../gcc/gcc/c-family/c-ppoutput.c:100 0xf10e2b c_common_init() ../../gcc/gcc/c-family/c-opts.c:1195 0xbe8ea7 cxx_init() ../../gcc/gcc/cp/lex.c:332 0x180c1af lang_dependent_init ../../gcc/gcc/toplev.c:1881 0x180ca61 do_compile ../../gcc/gcc/toplev.c:2178 Note that there is no assert if we are using import directly, without inclu= de translation.=