From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1AFE73857370; Sun, 15 May 2022 08:08:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AFE73857370 From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/105608] New: [13 Regression] ICE: in linemap_add, at libcpp/line-map.cc:502 on ovito-3.7.1 Date: Sun, 15 May 2022 08:08:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org 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: Sun, 15 May 2022 08:08:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105608 Bug ID: 105608 Summary: [13 Regression] ICE: in linemap_add, at libcpp/line-map.cc:502 on ovito-3.7.1 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- ICE initially observed on ovito-3.7.1 source code where -DCOPYRIGHT=3D"\"${long-string}\"" is used along with precompiled headers in standard cmake setup. Here is a 0-file reproducer: # create empty files and dirs: $ mkdir -p ph $ touch ph/h.hxx.cxx $ touch a.cpp # trigger the bug: $ /tmp/gb/gcc/xg++ -B/tmp/gb/gcc -Winvalid-pch -x c++-header -o ph/h.hxx.gc= h -c ph/h.hxx.cxx $ /tmp/gb/gcc/xg++ -B/tmp/gb/gcc -DBUG=3Daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -Winvalid-pch -include ph/h.hxx -o a.o -c a.cpp ph/h.hxx.cxx:1:116: internal compiler error: in linemap_add, at libcpp/line-map.cc:502 0x220adce linemap_add(line_maps*, lc_reason, unsigned int, char const*, unsigned int) <>/libcpp/line-map.cc:502 0x220b129 linemap_line_start(line_maps*, unsigned int, unsigned int) <>/libcpp/line-map.cc:827 0x220b3f3 linemap_position_for_column(line_maps*, unsigned int) <>/libcpp/line-map.cc:898 0x220802b _cpp_lex_direct <>/libcpp/lex.cc:3596 0x22119dd lex_expansion_token <>/libcpp/macro.cc:3552 0x22119dd create_iso_definition <>/libcpp/macro.cc:3665 0x22119dd _cpp_create_definition <>/libcpp/macro.cc:3829 0x2214574 cpp_read_state(cpp_reader*, char const*, _IO_FILE*, save_macro_da= ta*) <>/libcpp/pch.cc:841 0xad8b8d c_common_read_pch(cpp_reader*, char const*, int, char const*) <>/gcc/c-family/c-pch.cc:347 0x2201213 is_known_idempotent_file <>/libcpp/files.cc:817 0x2201213 _cpp_stack_file <>/libcpp/files.cc:906 0x220182e _cpp_stack_include <>/libcpp/files.cc:1113 0x2201e26 cpp_push_include(cpp_reader*, char const*) <>/libcpp/files.cc:1621 0xad5d51 push_command_line_include <>/gcc/c-family/c-opts.cc:1565 0xad5e79 cb_file_change <>/gcc/c-family/c-opts.cc:1619 0x21f95cc _cpp_do_file_change <>/libcpp/directives.cc:1181 0x21fa073 _cpp_pop_buffer <>/libcpp/directives.cc:2773 0x22045b0 _cpp_get_fresh_line <>/libcpp/lex.cc:3490 0x2207eb8 _cpp_lex_direct <>/libcpp/lex.cc:3552 0x2209867 _cpp_lex_token <>/libcpp/lex.cc:3398 gcc-12.1.0 does not seem to be affected. Only gcc-13 fails for me including current master. $ /tmp/gb/gcc/xg++ -B/tmp/gb/gcc -v Reading specs from /tmp/gb/gcc/specs COLLECT_GCC=3D/tmp/gb/gcc/xg++ COLLECT_LTO_WRAPPER=3D/tmp/gb/gcc/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: <>/configure --disable-multilib --disable-bootstrap --with-native-system-header-dir=3D/<>/glibc-2.34-115-dev/include --prefix=3D/tmp/gb/__td__ CFLAGS=3D'-O1 -ggdb3' CXXFLAGS=3D'-O1 -ggdb3' LDF= LAGS=3D'-O1 -ggdb3' Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.0 20220515 (experimental) (GCC)=